<br><div><span class="gmail_quote">On 4/12/06, <b class="gmail_sendername">"Martin v. Löwis"</b> <<a href="mailto:martin@v.loewis.de">martin@v.loewis.de</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Tim Peters quoted Guido:<br>> - when reload() is used on an extension<br><br>This is trickier: I guess reload should invoke the finalize function,<br>discard the memory for the state, and then invoke the initialize<br>
function again, which will allocate a new state block.</blockquote><div><br>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.)
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">This raises the question whether modules should be able to<br>participate in cyclic GC...
</blockquote><div><br>Don't they already? They have a traverse proc, just not a clear proc.<br></div></div><br>-- <br>Thomas Wouters <<a href="mailto:thomas@python.org">thomas@python.org</a>><br><br>Hi! I'm a .signature virus! copy me into your .signature file to help me spread!