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

I don't understand the tp_del / tp_dealloc argument here.  This is really not 
the concern of gc.  Gc only goes and finds unreachable objects, and if they are 
deemend collectable, makes them go away by clearing their references.
GC only cares that during the final release of any objects in a reference 
cycle, no non-trivial code may run (for various technical reasons).  So, 
objects deemed "sensitive" in this way, are left alone (and put in gc.garbage 
instead).
GC has no other knowledge of how objects behave, if or when any finalizers are 
called.  The only thing gc does is calling Py_DECREF (through the tp_clear 
slot).  Everything else is up to the objects.

The intent of this patch is for objects themselves to be able to provide better 
information to GC as to whether they are too "sensitive" to be cleared by GC, 
rather than GC relying solely on the presence of a __del__ method, or using the 
builtin special case knowledbe for PyGen objects.

Whether finalizers are called from tp_del or tp_dealloc is beyond the scope of 
the gc module or, indeed, this patch.

----------

_______________________________________
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