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 iabervon
Recipients docs@python, iabervon, tim.peters
Date 2020-06-30.04:26:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1593491195.45.0.448474670044.issue41133@roundup.psfhosted.org>
In-reply-to
Content
I think it would be helpful to have something as troubleshooting information on the garbage collector. If you've got a bug in your C module, it's obvious that you shouldn't be doing something egregiously wrong, but it's not obvious what you might have done wrong in order to cause that particular failure.

It wouldn't be useful to promise that, if you have a particular sort of bug, you'll get a particular sort of failure, or keep it the same from version to version, but it would be nice to be told, if you're getting tp_clear called on objects that aren't garbage in this particular version of Python, look for cases where you're calling py_VISIT on it more times than you called Py_INCREF. Alternatively, it would be helpful for the API documentation to say, "If you are having some strange problem with garbage collection, here's documentation (Developer Guide link) on what's really going on in the garbage collector, which might help explain what you could be doing wrong to get that effect."

For that matter, the documentation for tp_traverse doesn't mention that you have to call Py_VISIT on each object exactly as many times as references you hold to it; the phrasing sounds like it's fine so long as you call it at least once on any object you hold a reference to.
History
Date User Action Args
2020-06-30 04:26:35iabervonsetrecipients: + iabervon, tim.peters, docs@python
2020-06-30 04:26:35iabervonsetmessageid: <1593491195.45.0.448474670044.issue41133@roundup.psfhosted.org>
2020-06-30 04:26:35iabervonlinkissue41133 messages
2020-06-30 04:26:35iabervoncreate