From f278b8fefca7ad5d0e95c4b5df39807a80cf821a Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Fri, 19 Apr 2024 11:44:19 +0200 Subject: [PATCH] [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 5d544365742a117027747306e2d4473f3b73d921) Co-authored-by: Savannah Ostrowski --- Doc/c-api/typeobj.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index b30c22f4fdd..f6d865f2f52 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -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 ` + as they can form a reference cycle with their own module object. **Inheritance:**