On 4/12/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
Actually, no, reload() has to remove the module from sys.modules and load it anew. The reason for this is that any instances of types defined in the module can still live, after the reload, and they would still refer to their old-module-object-referring types. (And, as you said, this is a reason to keep the 'state' in module objects.)
Don't they already? They have a traverse proc, just not a clear proc.
Tim Peters quoted Guido:
> - when reload() is used on an extension
This is trickier: I guess reload should invoke the finalize function,
discard the memory for the state, and then invoke the initialize
function again, which will allocate a new state block.
Actually, no, reload() has to remove the module from sys.modules and load it anew. The reason for this is that any instances of types defined in the module can still live, after the reload, and they would still refer to their old-module-object-referring types. (And, as you said, this is a reason to keep the 'state' in module objects.)
This raises the question whether modules should be able to
participate in cyclic GC...
Don't they already? They have a traverse proc, just not a clear proc.
--
Thomas Wouters <[EMAIL PROTECTED]>
Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
_______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
