From daba4dd891bb0b92ab531add8ca223917a4db5e4 Mon Sep 17 00:00:00 2001 From: Savannah Ostrowski Date: Thu, 18 Apr 2024 03:57:34 +0000 Subject: [PATCH 1/5] Add note about heap type gc requirement --- 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 e66ab01878cac0..af3b91f8703225 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 must also support garbage collection as + they can form a reference cycle with their own module object. **Inheritance:** From 0717c156dbe16eada77d0600516b1cfdfa96e4f2 Mon Sep 17 00:00:00 2001 From: Savannah Ostrowski Date: Fri, 19 Apr 2024 04:17:01 +0000 Subject: [PATCH 2/5] add reference to cyclic gc --- 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 af3b91f8703225..34d12243f22530 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -1035,7 +1035,8 @@ and :c:data:`PyType_Type` effectively act as defaults.) 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). Heap types must also support garbage collection as - they can form a reference cycle with their own module object. + they can form a `reference cycle `_ + with their own module object. **Inheritance:** From c6609a8d1ec05e81ae94aa0d2d41f81e900c35dc Mon Sep 17 00:00:00 2001 From: Savannah Ostrowski Date: Fri, 19 Apr 2024 04:56:34 +0000 Subject: [PATCH 3/5] update reference --- Doc/c-api/typeobj.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index 34d12243f22530..7cd9fe744ae3fd 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -1034,9 +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). Heap types must also support garbage collection as - they can form a `reference cycle `_ - with their own module object. + DECREF'ed). Heap types must also :ref:`support garbage collection ` as + they can form a reference cycle with their own module object. **Inheritance:** From e0bc46b697452fa2e13cd020c29201d3eab51c83 Mon Sep 17 00:00:00 2001 From: Savannah Ostrowski Date: Fri, 19 Apr 2024 04:59:10 +0000 Subject: [PATCH 4/5] line length --- Doc/c-api/typeobj.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index 7cd9fe744ae3fd..56a5c6205d2f2e 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -1034,8 +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). Heap types must also :ref:`support garbage collection ` as - they can form a reference cycle with their own module object. + DECREF'ed). Heap types must also :ref:`support garbage collection ` + as they can form a reference cycle with their own module object. **Inheritance:** From 4ebe973cdc093b4b7ab4ede39e5500c74fcac6f4 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 19 Apr 2024 11:01:21 +0200 Subject: [PATCH 5/5] =?UTF-8?q?=E2=80=9Cshould=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Doc/c-api/typeobj.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index 56a5c6205d2f2e..1105b943325077 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -1034,7 +1034,7 @@ 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). Heap types must also :ref:`support garbage collection ` + DECREF'ed). Heap types should also :ref:`support garbage collection ` as they can form a reference cycle with their own module object. **Inheritance:**