Re: [Python-Dev] PyObject_GC_UnTrack() no longer reliable in 2.7?

2010-09-26 Thread Nick Coghlan
On Sat, Sep 25, 2010 at 9:20 AM, Tim Peters tim.pet...@gmail.com wrote: [MvL] I think it would be possible to have two versions of _PyGC_REFS_UNTRACKED, one being, say, -5. _PyGC_REFS_UNTRACKED_AND_KEEP_IT_THAT_WAY would be what you get when you call PyObject_GC_UnTrack; the code to do

Re: [Python-Dev] PyObject_GC_UnTrack() no longer reliable in 2.7?

2010-09-26 Thread Martin v. Löwis
Am 26.09.2010 12:54, schrieb Nick Coghlan: On Sat, Sep 25, 2010 at 9:20 AM, Tim Peters tim.pet...@gmail.com wrote: [MvL] I think it would be possible to have two versions of _PyGC_REFS_UNTRACKED, one being, say, -5. _PyGC_REFS_UNTRACKED_AND_KEEP_IT_THAT_WAY would be what you get when you

[Python-Dev] PyObject_GC_UnTrack() no longer reliable in 2.7?

2010-09-24 Thread Tim Peters
Looks like 2.7 changes introduced to exempt dicts and tuples from cyclic gc if they obviously can't be in cycles has some unintended consequences. Specifically, if an extension module calls PyObject_GC_UnTrack() on a dict it _does not want tracked_, Python can start tracking the dict again. I

Re: [Python-Dev] PyObject_GC_UnTrack() no longer reliable in 2.7?

2010-09-24 Thread Antoine Pitrou
On Fri, 24 Sep 2010 15:14:32 -0400 Tim Peters tim.pet...@gmail.com wrote: Looks like 2.7 changes introduced to exempt dicts and tuples from cyclic gc if they obviously can't be in cycles has some unintended consequences. Specifically, if an extension module calls PyObject_GC_UnTrack() on a

Re: [Python-Dev] PyObject_GC_UnTrack() no longer reliable in 2.7?

2010-09-24 Thread Jim Fulton
On Fri, Sep 24, 2010 at 3:36 PM, Antoine Pitrou solip...@pitrou.net wrote: On Fri, 24 Sep 2010 15:14:32 -0400 Tim Peters tim.pet...@gmail.com wrote: Looks like 2.7 changes introduced to exempt dicts and tuples from cyclic gc if they obviously can't be in cycles has some unintended

Re: [Python-Dev] PyObject_GC_UnTrack() no longer reliable in 2.7?

2010-09-24 Thread Martin v. Löwis
I assume this is unintended because (a) the docs weren't changed to warn about this; and, (b) it's wrong ;-) It seems Jim is happy with (or has at least accepted) the behavior change. Would you still like to see it fixed (or, rather, have the 2.6 state restored)? I think it would be possible

Re: [Python-Dev] PyObject_GC_UnTrack() no longer reliable in 2.7?

2010-09-24 Thread Daniel Stutzbach
On Fri, Sep 24, 2010 at 4:09 PM, Martin v. Löwis mar...@v.loewis.dewrote: I think it would be possible to have two versions of _PyGC_REFS_UNTRACKED, one being, say, -5. _PyGC_REFS_UNTRACKED_AND_KEEP_IT_THAT_WAY would be what you get when you call PyObject_GC_UnTrack; the code to do automatic

Re: [Python-Dev] PyObject_GC_UnTrack() no longer reliable in 2.7?

2010-09-24 Thread Martin v. Löwis
Am 24.09.2010 23:22, schrieb Daniel Stutzbach: On Fri, Sep 24, 2010 at 4:09 PM, Martin v. Löwis mar...@v.loewis.de mailto:mar...@v.loewis.de wrote: I think it would be possible to have two versions of _PyGC_REFS_UNTRACKED, one being, say, -5.

Re: [Python-Dev] PyObject_GC_UnTrack() no longer reliable in 2.7?

2010-09-24 Thread Tim Peters
[Tim] I assume this is unintended because (a) the docs weren't changed to warn about this; and, (b) it's wrong ;-) [Martin v. Löwis] It seems Jim is happy with (or has at least accepted) the behavior change. Would you still like to see it fixed (or, rather, have the 2.6 state restored)?