[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 5d54436574)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-04-19 11:44:19 +02:00 committed by GitHub
parent 15be34ade8
commit f278b8fefc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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