8000 gh-116935: Document that heap types need to support garbage collectio… · python/cpython@5d54436 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5d54436

Browse files
gh-116935: Document that heap types need to support garbage collection (GH-118021)
1 parent 4605a19 commit 5d54436

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
@@ -1034,7 +1034,8 @@ and :c:data:`PyType_Type` effectively act as defaults.)
10341034
the type, and the type object is INCREF'ed when a new instance is created, and
10351035
DECREF'ed when an instance is destroyed (this does not apply to instances of
10361036
subtypes; only the type referenced by the instance's ob_type gets INCREF'ed or
1037-
DECREF'ed).
1037+
DECREF'ed). Heap types should also :ref:`support garbage collection <supporting-cycle-detection>`
1038+
as they can form a reference cycle with their own module object.
10381039

10391040
**Inheritance:**
10401041

0 commit comments

Comments
 (0)
0