Skip to content

Commit dc1b56a

Browse files
gh-141004: Document missing type flags (GH-145127)
1 parent 98b1e51 commit dc1b56a

File tree

2 files changed

+46
-3
lines changed

2 files changed

+46
-3
lines changed

Doc/c-api/typeobj.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,6 +1499,52 @@ and :c:data:`PyType_Type` effectively act as defaults.)
14991499
It will be removed in a future version of CPython
15001500

15011501

1502+
.. c:macro:: Py_TPFLAGS_HAVE_VERSION_TAG
1503+
1504+
This is a :term:`soft deprecated` macro that does nothing.
1505+
Historically, this would indicate that the
1506+
:c:member:`~PyTypeObject.tp_version_tag` field was available and
1507+
initialized.
1508+
1509+
1510+
.. c:macro:: Py_TPFLAGS_INLINE_VALUES
1511+
1512+
This bit indicates that instances of this type will have an "inline values"
1513+
array (containing the object's attributes) placed directly after the end
1514+
of the object.
1515+
1516+
This requires that :c:macro:`Py_TPFLAGS_HAVE_GC` is set.
1517+
1518+
**Inheritance:**
1519+
1520+
This flag is not inherited.
1521+
1522+
.. versionadded:: 3.13
1523+
1524+
1525+
.. c:macro:: Py_TPFLAGS_IS_ABSTRACT
1526+
1527+
This bit indicates that this is an abstract type and therefore cannot
1528+
be instantiated.
1529+
1530+
**Inheritance:**
1531+
1532+
This flag is not inherited.
1533+
1534+
.. seealso::
1535+
:mod:`abc`
1536+
1537+
1538+
.. c:macro:: Py_TPFLAGS_HAVE_STACKLESS_EXTENSION
1539+
1540+
Internal. Do not set or unset this flag.
1541+
Historically, this was a reserved flag for use in Stackless Python.
1542+
1543+
.. warning::
1544+
This flag is present in header files, but is not be used.
1545+
This may be removed in a future version of CPython.
1546+
1547+
15021548
.. c:member:: const char* PyTypeObject.tp_doc
15031549
15041550
.. corresponding-type-slot:: Py_tp_doc

Tools/check-c-api-docs/ignored_c_api.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ Py_HASH_EXTERNAL
2222
PyABIInfo_FREETHREADING_AGNOSTIC
2323
# object.h
2424
Py_INVALID_SIZE
25-
Py_TPFLAGS_HAVE_VERSION_TAG
26-
Py_TPFLAGS_INLINE_VALUES
27-
Py_TPFLAGS_IS_ABSTRACT
2825
# pyexpat.h
2926
PyExpat_CAPI_MAGIC
3027
PyExpat_CAPSULE_NAME

0 commit comments

Comments
 (0)