]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-116935: Document that heap types need to support garbage collection (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 19 Apr 2024 09:44:19 +0000 (11:44 +0200)
committerGitHub <noreply@github.com>
Fri, 19 Apr 2024 09:44:19 +0000 (11:44 +0200)
gh-116935: Document that heap types need to support garbage collection (GH-118021)
(cherry picked from commit 5d544365742a117027747306e2d4473f3b73d921)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
Doc/c-api/typeobj.rst

index b30c22f4fddeba42c4a925a3401819da8e9a489f..f6d865f2f52219663cc45d67be60244017c625f6 100644 (file)
@@ -1052,7 +1052,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:**