[issue9141] Allow objects to decide if they can be collected by GC
Antoine Pitrou
report at bugs.python.org
Sun Jul 4 19:59:13 CEST 2010
Antoine Pitrou <pitrou at free.fr> added the comment:
> All this patch does, is to generalize the mechanism already provided
> for genobject.c (by PyGen_NeedsFinalizing()), to any object: Any
> object can signal to gc that: a) it is ok to collect a cycle with me
> in it, or b) no, it is unsafe to do so. With this patch in place,
> PyGen_NeedsFinalizing() no longer needs to be a special case in
> gcmodule.c.
Adding an API function and an additional traversal pass to the GC just
for the sake of removing a special case doesn't seem reasonable to me.
That's why I'm asking what specific problem you are trying to solve.
(rather than simply trying to make things "nicer")
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9141>
_______________________________________
More information about the Python-bugs-list
mailing list