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

This commit is contained in:
Savannah Ostrowski 2024-04-19 02:29:23 -07:00 committed by GitHub
parent 4605a197bd
commit 5d54436574
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View 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:**