Two versions of the same class
Jason Orendorff
jason at jorendorff.com
Wed Jan 30 10:19:28 EST 2002
> The "anomaly" is happening between two separate HTTP connections. On the
> first connection, I instantiate an object and store it in a
> dictionary. If I
> test whether instance.__class__ = CLASS (the class I instantiated
> from), it
> returns true, i.e It is the identical class at the same memory
> location. On
> the second connection, I retrieve that instance from the dictionary (the
> dictionary is global and maintained between connections).
The class definition, then, needs to be global and maintained between
connections as well. Otherwise you get a different class each time
you execute the class definition.
I don't know much about mod_python, but is true in general.
## Jason Orendorff http://www.jorendorff.com/
More information about the Python-list
mailing list