[Pythonmac-SIG] Reload() not working?
Jack Jansen
jack@oratrix.nl
Mon, 23 Jul 2001 12:05:54 +0200
> I have a similar problem when defining a class. If I run the script and
> then change some method, doing reload() does not actualize the method.
Note that this is expected behaviour. If you create an object with the old
module and then reload the module the old object will still refer to the old
module. If you think about how Python objects work this is no more than
logical: there's no way Python can go into the object and change its class
(and thereby its methods) on the fly. Only newly created objects will get the
new class and methods.
If I'm misunderstanding you and objects that are created after you've reloaded
the module also see the old method then that's indeed a bug, so please let me
know.
Tom: could it be that this is your problem too?
--
Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm