]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-116935: Document that heap types need to support garbage collection (GH-118021)
authorSavannah Ostrowski <savannahostrowski@gmail.com>
Fri, 19 Apr 2024 09:29:23 +0000 (02:29 -0700)
committerGitHub <noreply@github.com>
Fri, 19 Apr 2024 09:29:23 +0000 (09:29 +0000)
Doc/c-api/typeobj.rst

index e66ab01878cac05cce909b414ec6b4d93f885b62..1105b943325077398d5d7cb7c4c776cf7040ed40 100644 (file)
@@ -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 <supporting-cycle-detection>`
+      as they can form a reference cycle with their own module object.
 
       **Inheritance:**