This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sbt
Recipients pitrou, sbt
Date 2013-06-15.19:43:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
On 15/06/2013 7:11pm, Antoine Pitrou wrote:
>> Usually garbage collection will end up clearing the module's dict anyway.
> This is not true, since global objects might have a __del__ and then hold
> the whole module dict alive through a reference cycle. Happily though,
> PEP 442 is going to make that concern obsolete.

I did say "usually".

> As for the interpreter shutdown itself, I have a pending patch (post-PEP 442)
> to get rid of the globals cleanup as well. It may be better to merge the two approaches.

So you would just depend on garbage collection?  Do you know how many 
refs/blocks are left at exit if one just uses garbage collection 
(assuming PEP 442 is in effect)?  I suppose adding GC support to those 
modules which currently lack it would help a lot.

BTW, I had a more complicated patch which keeps track of module dicts 
using weakrefs and purges any which were left after garbage collection 
has had a chance to free stuff.  But most module dicts ended up being 
purged anyway, so it did not seem worth the hassle when a two-line patch 
mostly fixes the immediate problem.
Date User Action Args
2013-06-15 19:43:07sbtsetrecipients: + sbt, pitrou
2013-06-15 19:43:07sbtlinkissue18214 messages
2013-06-15 19:43:07sbtcreate