Message191229
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:07 | sbt | set | recipients:
+ sbt, pitrou |
2013-06-15 19:43:07 | sbt | link | issue18214 messages |
2013-06-15 19:43:07 | sbt | create | |
|