Kristján Valur Jónsson <krist...@ccpgames.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9141>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to