https://github.com/python/cpython/commit/5d544365742a117027747306e2d4473f3b73d921
commit: 5d544365742a117027747306e2d4473f3b73d921
branch: main
author: Savannah Ostrowski <[email protected]>
committer: encukou <[email protected]>
date: 2024-04-19T09:29:23Z
summary:

gh-116935: Document that heap types need to support garbage collection 
(GH-118021)

files:
M Doc/c-api/typeobj.rst

diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst
index e66ab01878cac0..1105b943325077 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 
<supporting-cycle-detection>`
+      as they can form a reference cycle with their own module object.
 
       **Inheritance:**
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to