From 648b8eb415305b9e84614b0cb53e4b6e59ec3a68 Mon Sep 17 00:00:00 2001 From: Peter Bierma Date: Sun, 22 Feb 2026 14:20:55 -0500 Subject: [PATCH 1/5] Document missing type flags. --- Doc/c-api/typeobj.rst | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index bc134b5d00b4ad..006d6bd13c8e1f 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -1498,6 +1498,45 @@ and :c:data:`PyType_Type` effectively act as defaults.) This flag is present in header files, but is not be used. It will be removed in a future version of CPython + .. c:macro:: Py_TPFLAGS_HAVE_VERSION_TAG + This is a :term:`soft deprecated` macro that does nothing. + Historically, this would indicate that the + :c:member:`~PyTypeObject.tp_version_tag` field was available and + initialized. + + .. c:macro:: Py_TPFLAGS_INLINE_VALUES + This bit indicates that instances of this type will have an "inline values" + array (containing the object's attributes) placed directly after the end + of the object. + + This requires that :c:macro:`Py_TPFLAGS_HAVE_GC` is set. + + **Inheritance:** + + This flag is not inherited. + + .. versionadded:: 3.13 + + .. c:macro:: Py_TPFLAGS_IS_ABSTRACT + This bit indicates that this is an abstract type and therefore cannot + be instantiated. + + **Inheritance:** + + This flag is not inherited. + + .. seealso:: + :mod:`abc` + + .. c:macro:: Py_TPFLAGS_HAVE_STACKLESS_EXTENSION + + Internal. Do not set or unset this flag. + Historically, this was a reserved flag for use in Stackless Python. + + .. warning:: + This flag is present in header files, but is not be used. + This may be removed in a future version of CPython. + .. c:member:: const char* PyTypeObject.tp_doc From c6d0094bfc2c84c9b5f404648ae4043d7267eed4 Mon Sep 17 00:00:00 2001 From: Peter Bierma Date: Sun, 22 Feb 2026 14:23:17 -0500 Subject: [PATCH 2/5] Fix spacing. --- Doc/c-api/typeobj.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index 006d6bd13c8e1f..f32f582a8f4217 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -1498,12 +1498,14 @@ and :c:data:`PyType_Type` effectively act as defaults.) This flag is present in header files, but is not be used. It will be removed in a future version of CPython + .. c:macro:: Py_TPFLAGS_HAVE_VERSION_TAG This is a :term:`soft deprecated` macro that does nothing. Historically, this would indicate that the :c:member:`~PyTypeObject.tp_version_tag` field was available and initialized. + .. c:macro:: Py_TPFLAGS_INLINE_VALUES This bit indicates that instances of this type will have an "inline values" array (containing the object's attributes) placed directly after the end @@ -1517,6 +1519,7 @@ and :c:data:`PyType_Type` effectively act as defaults.) .. versionadded:: 3.13 + .. c:macro:: Py_TPFLAGS_IS_ABSTRACT This bit indicates that this is an abstract type and therefore cannot be instantiated. @@ -1528,6 +1531,7 @@ and :c:data:`PyType_Type` effectively act as defaults.) .. seealso:: :mod:`abc` + .. c:macro:: Py_TPFLAGS_HAVE_STACKLESS_EXTENSION Internal. Do not set or unset this flag. From 416f10a292982d8eed3623776747ce10f9f47cdc Mon Sep 17 00:00:00 2001 From: Peter Bierma Date: Sun, 22 Feb 2026 14:38:13 -0500 Subject: [PATCH 3/5] Fix indentation. --- Doc/c-api/typeobj.rst | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index f32f582a8f4217..397cdc902bdb8b 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -1500,27 +1500,30 @@ and :c:data:`PyType_Type` effectively act as defaults.) .. c:macro:: Py_TPFLAGS_HAVE_VERSION_TAG - This is a :term:`soft deprecated` macro that does nothing. - Historically, this would indicate that the - :c:member:`~PyTypeObject.tp_version_tag` field was available and - initialized. + + This is a :term:`soft deprecated` macro that does nothing. + Historically, this would indicate that the + :c:member:`~PyTypeObject.tp_version_tag` field was available and + initialized. .. c:macro:: Py_TPFLAGS_INLINE_VALUES - This bit indicates that instances of this type will have an "inline values" - array (containing the object's attributes) placed directly after the end - of the object. - This requires that :c:macro:`Py_TPFLAGS_HAVE_GC` is set. + This bit indicates that instances of this type will have an "inline values" + array (containing the object's attributes) placed directly after the end + of the object. - **Inheritance:** + This requires that :c:macro:`Py_TPFLAGS_HAVE_GC` is set. - This flag is not inherited. + **Inheritance:** - .. versionadded:: 3.13 + This flag is not inherited. + + .. versionadded:: 3.13 .. c:macro:: Py_TPFLAGS_IS_ABSTRACT + This bit indicates that this is an abstract type and therefore cannot be instantiated. @@ -1534,12 +1537,12 @@ and :c:data:`PyType_Type` effectively act as defaults.) .. c:macro:: Py_TPFLAGS_HAVE_STACKLESS_EXTENSION - Internal. Do not set or unset this flag. - Historically, this was a reserved flag for use in Stackless Python. + Internal. Do not set or unset this flag. + Historically, this was a reserved flag for use in Stackless Python. - .. warning:: - This flag is present in header files, but is not be used. - This may be removed in a future version of CPython. + .. warning:: + This flag is present in header files, but is not be used. + This may be removed in a future version of CPython. .. c:member:: const char* PyTypeObject.tp_doc From 573313b9a0c658f002706585d195c68ec8acb6fe Mon Sep 17 00:00:00 2001 From: Peter Bierma Date: Sun, 22 Feb 2026 14:38:41 -0500 Subject: [PATCH 4/5] Remove from undocumented list. --- Tools/check-c-api-docs/ignored_c_api.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/Tools/check-c-api-docs/ignored_c_api.txt b/Tools/check-c-api-docs/ignored_c_api.txt index e628bdfebcbded..41439862741bcd 100644 --- a/Tools/check-c-api-docs/ignored_c_api.txt +++ b/Tools/check-c-api-docs/ignored_c_api.txt @@ -24,9 +24,6 @@ PyABIInfo_FREETHREADING_AGNOSTIC PyModuleDef_Type # object.h Py_INVALID_SIZE -Py_TPFLAGS_HAVE_VERSION_TAG -Py_TPFLAGS_INLINE_VALUES -Py_TPFLAGS_IS_ABSTRACT # pyexpat.h PyExpat_CAPI_MAGIC PyExpat_CAPSULE_NAME From d950daeaf88d62b610fa0e41379e3414e3e6fa39 Mon Sep 17 00:00:00 2001 From: Peter Bierma Date: Sun, 22 Feb 2026 14:40:32 -0500 Subject: [PATCH 5/5] Fix indentation again. --- Doc/c-api/typeobj.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index 397cdc902bdb8b..87b488912653b9 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -1540,9 +1540,9 @@ and :c:data:`PyType_Type` effectively act as defaults.) Internal. Do not set or unset this flag. Historically, this was a reserved flag for use in Stackless Python. - .. warning:: - This flag is present in header files, but is not be used. - This may be removed in a future version of CPython. + .. warning:: + This flag is present in header files, but is not be used. + This may be removed in a future version of CPython. .. c:member:: const char* PyTypeObject.tp_doc