31 Dec
2012
31 Dec
'12
5:52 a.m.
On Mon, 31 Dec 2012 10:25:25 +1300
Greg Ewing
Richard Oudkerk wrote:
Personally I would like to get rid of the "purge globals" behaviour for modules deleted before shutdown has started: if someone manipulates sys.modules then they can just call gc.collect() if they want to promptly get rid of orphaned reference cycles.
Now that we have cyclic gc, is there any need for the shutdown purge at all?
If you have an object with a __del__ method as a module global, the cyclic gc will refuse to consider the module globals at all (which means it will affect unrelated objects). So, yes, I think the shutdown purge is still necessary. Perhaps there are ways to make it smarter. Regards Antoine.