Re: [Python-Dev] Module cleanup improvement

2007-05-22 Thread Greg Ewing
Armin Rigo wrote: > if we consider a > CPython in which the cycle GC has been disabled by the user, then many > __del__'s would not be called any more at interpreter shutdown. That can happen now anyway. Module clearing only cleans up cycles that go through the module dict. +1 from me on getting

Re: [Python-Dev] Module cleanup improvement

2007-05-22 Thread Tim Peters
[Armin Rigo] > On another level, would there be interest here for me to revive my old > attempt at throwing away this messy procedure, which only made sense in > a world where reference cycles couldn't be broken? Definitely. > Nowadays the fact that global variables suddenly become None when the

Re: [Python-Dev] Module cleanup improvement

2007-05-22 Thread Martin v. Löwis
> On another level, would there be interest here for me to revive my old > attempt at throwing away this messy procedure, which only made sense in > a world where reference cycles couldn't be broken? I definitely think Py3k, at least, should use such an approach - especially with PEP 3121, which s

Re: [Python-Dev] Module cleanup improvement

2007-05-22 Thread Armin Rigo
Hi Alan, On Mon, May 21, 2007 at 08:17:02PM -0400, Alan McIntyre wrote: > Adding a step C1.5 which removes only objects that return true for > PyInstance_Check seems to prevent the problem exhibited by this bug (I > tried it out locally on the trunk and it doesn't cause any problems > with the reg

[Python-Dev] Module cleanup improvement

2007-05-21 Thread Alan McIntyre
Hi all, Bug #1717900 has an example of a script that causes a (cryptic, IMO) error during module cleanup since instances of a class just happen to get destroyed after their class is destroyed, and the __del__ method manipulates a class attribute. As I understand it this is expected under the beha