diff options
author | Savannah Ostrowski <savannahostrowski@gmail.com> | 2024-04-19 09:29:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-19 09:29:23 (GMT) |
commit | 5d544365742a117027747306e2d4473f3b73d921 (patch) | |
tree | 68d0faaef46bb65f147b16018889739bdfa58f9b | |
parent | 4605a197bd84da1a232bd835d8e8e654f2fef220 (diff) | |
download | cpython-5d544365742a117027747306e2d4473f3b73d921.zip cpython-5d544365742a117027747306e2d4473f3b73d921.tar.gz cpython-5d544365742a117027747306e2d4473f3b73d921.tar.bz2 |
gh-116935: Document that heap types need to support garbage collection (GH-118021)
-rw-r--r-- | Doc/c-api/typeobj.rst | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index e66ab01..1105b94 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -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:** |