This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author petr.viktorin
Recipients ncoghlan, petr.viktorin
Date 2015-06-04.08:53:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1433407990.81.0.118639626217.issue24373@psf.upfronthosting.co.za>
In-reply-to
Content
tp_traverse is completely orthogonal to tp_dealloc, it's needed to detect (and then break) reference cycles like:
    obj = xxlimited.Xxo()
    obj.foo = obj

As for tp_finalize: yes, mentioning it in tp_dealloc docs would be good, but I'll need a bit more studying to understand the problem correctly. The cases fixed here are relatively simple; Antoine gives more complex ones in [0]. When I feel qualified to give advice, I'll change the docs. (And most likely, write a PEP to make things easier; some changes to classes will be needed anyway to make PEP 489 multi-phase init work nicely in all cases).
But, I plan to focus my CPython time on documenting PEP 489 before diving in here. I think issue 16690 is a good place to track tp_dealloc docs changes.

[0] https://mail.python.org/pipermail/python-dev/2015-June/140423.html
History
Date User Action Args
2015-06-04 08:53:10petr.viktorinsetrecipients: + petr.viktorin, ncoghlan
2015-06-04 08:53:10petr.viktorinsetmessageid: <1433407990.81.0.118639626217.issue24373@psf.upfronthosting.co.za>
2015-06-04 08:53:10petr.viktorinlinkissue24373 messages
2015-06-04 08:53:10petr.viktorincreate