From: Savannah Ostrowski Date: Fri, 19 Apr 2024 09:29:23 +0000 (-0700) Subject: gh-116935: Document that heap types need to support garbage collection (GH-118021) X-Git-Tag: v3.13.0b1~340 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5d544365742a117027747306e2d4473f3b73d921;p=thirdparty%2FPython%2Fcpython.git gh-116935: Document that heap types need to support garbage collection (GH-118021) --- diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index e66ab01878ca..1105b9433250 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -1034,7 +1034,8 @@ and :c:data:`PyType_Type` effectively act as defaults.) the type, and the type object is INCREF'ed when a new instance is created, and DECREF'ed when an instance is destroyed (this does not apply to instances of subtypes; only the type referenced by the instance's ob_type gets INCREF'ed or - DECREF'ed). + DECREF'ed). Heap types should also :ref:`support garbage collection ` + as they can form a reference cycle with their own module object. **Inheritance:**