Anssi Kääriäinen added the comment:

I wonder if it would be better to reword the garbage collection docs to mention 
that Python can't collect objects if they are part of a reference cycle, and 
some of the objects in the reference cycle need to run code at gc time. Then 
mention that such objects include objects with __del__ and also generators if 
they do have some other blocks than loops in them (for example try or with 
blocks).

To me it seems this issue could be mitigated somewhat by collecting the objects 
if there is just one object with finalizer code in the cycle. It should be safe 
to run the single finalizer, then collect the whole cycle, right?

----------

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

Reply via email to