Skip to content

Commit f278b8f

Browse files
[3.12] gh-116935: Document that heap types need to support garbage collection (GH-118021) (GH-118092)
gh-116935: Document that heap types need to support garbage collection (GH-118021) (cherry picked from commit 5d54436) Co-authored-by: Savannah Ostrowski <[email protected]>
1 parent 15be34a commit f278b8f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Doc/c-api/typeobj.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,8 @@ and :c:data:`PyType_Type` effectively act as defaults.)
10521052
the type, and the type object is INCREF'ed when a new instance is created, and
10531053
DECREF'ed when an instance is destroyed (this does not apply to instances of
10541054
subtypes; only the type referenced by the instance's ob_type gets INCREF'ed or
1055-
DECREF'ed).
1055+
DECREF'ed). Heap types should also :ref:`support garbage collection <supporting-cycle-detection>`
1056+
as they can form a reference cycle with their own module object.
10561057

10571058
**Inheritance:**
10581059

0 commit comments

Comments
 (0)