[issue41133] Insufficient description of cyclic garbage collector for C API

Tim Peters report at bugs.python.org
Mon Jun 29 22:41:30 EDT 2020


Tim Peters <tim at python.org> added the comment:

I don't see real value in the docs noting that Bad Things can happen if code lies about true refcounts. If a container points to an object, _of course_ the container should own that reference. Cheating on that isn't intended to be supported in any way, so there's no obligation to explain how or why things can go wrong otherwise. Worse, trying to explain such things would constrain implementations to have the same specific kinds of failure modes forever after. Neither would there would be real value in repeating "DON'T LIE ABOUT REFCOUNTS!" on every page, either ;-)

If someone just wants to know more about CPython's cyclic collector, that's fine, but that takes a great many more words than are suitable in the C API docs. Luckily, Pablo recently did that:

https://devguide.python.org/garbage_collector/

----------
nosy: +tim.peters

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41133>
_______________________________________


More information about the Python-bugs-list mailing list