I have a simple form in python + pylons that submits to a controller. However, each page load doesn’t seem to be a fresh instantiation of the class. Rather, class variables specified on the previous page load are still accessible.
What’s going on here? And what’s the solution?
A common programmer oversight is that defining a list [] as a default argument or class initialiser is evaluated only once. If you have class variables such as lists, I recommend you initialise them in init. I’ll give you an example.