[issue9141] Allow objects to decide if they can be collected by GC

Daniel Stutzbach report at bugs.python.org
Fri Apr 6 22:03:20 CEST 2012


Daniel Stutzbach <stutzbach at google.com> added the comment:

On Fri, Apr 6, 2012 at 12:51 PM, Jim Jewett <report at bugs.python.org> wrote:

> __del__ methods do run, even if an object was collected by the cycle
> detector.  And they can't do any harm that couldn't also be done by a C
> finalizer.
>

No, if an object with a __del__ method is part of a cycle, it is not
collected.  The objects get appended to gc.garbage instead.

See:  http://docs.python.org/py3k/library/gc.html#gc.garbage

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9141>
_______________________________________


More information about the Python-bugs-list mailing list