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 kristjan.jonsson
Recipients Jim.Jewett, amaury.forgeotdarc, asvetlov, dstanek, kristjan.jonsson, loewis, pitrou, rhettinger, stutzbach, tim.peters
Date 2012-04-06.20:24:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1333743882.45.0.896174340471.issue9141@psf.upfronthosting.co.za>
In-reply-to
Content
Right Daniel, but currently an exception is made for Generator objects.  The generator can tell that the finalizer won't do anything and then allow collection regardless.  It knows the finalizer and that in its state it will at most do some Py_DECREF operations.

This patch aims to generalize this exception mechanism, and also its opposite, so that we don´t need to rely on the presence of the finalizer slot to decide.  We can then remove a silly function from the public (but undocumented) API.

Of course, you can only allow collectino of an object with a finalizer if you know for sure that it will not do anything but Py_DECREF.  This is possible for generators because they are not an inheritable class.  But we could never do this in general for a python class.  Even running .py code from the GC collector cycle would crash everything instantly.
History
Date User Action Args
2012-04-06 20:24:42kristjan.jonssonsetrecipients: + kristjan.jonsson, tim.peters, loewis, rhettinger, amaury.forgeotdarc, pitrou, dstanek, stutzbach, asvetlov, Jim.Jewett
2012-04-06 20:24:42kristjan.jonssonsetmessageid: <1333743882.45.0.896174340471.issue9141@psf.upfronthosting.co.za>
2012-04-06 20:24:41kristjan.jonssonlinkissue9141 messages
2012-04-06 20:24:41kristjan.jonssoncreate