diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst index ed64f0576ff5a7..1ae8f35c8b8c6a 100644 --- a/Doc/c-api/object.rst +++ b/Doc/c-api/object.rst @@ -427,10 +427,10 @@ Object Protocol .. c:function:: PyObject* PyObject_GetItemData(PyObject *o) Get a pointer to per-item data for a class with - :c:macro:`Py_TPFLAGS_ITEMS_AT_END`. + :const:`Py_TPFLAGS_ITEMS_AT_END`. On error, set an exception and return ``NULL``. :py:exc:`TypeError` is raised if *o* does not have - :c:macro:`Py_TPFLAGS_ITEMS_AT_END` set. + :const:`Py_TPFLAGS_ITEMS_AT_END` set. .. versionadded:: 3.12 diff --git a/Doc/c-api/type.rst b/Doc/c-api/type.rst index bb133f7f98a84f..7eb64a4245159b 100644 --- a/Doc/c-api/type.rst +++ b/Doc/c-api/type.rst @@ -363,7 +363,7 @@ The following functions and structs are used to create - The requested :c:member:`PyType_Spec.basicsize` is zero, suggesting that the subclass does not access the instance's memory directly. - - With the :c:macro:`Py_TPFLAGS_ITEMS_AT_END` flag. + - With the :const:`Py_TPFLAGS_ITEMS_AT_END` flag. .. c:member:: int flags diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index 2a6a28c2459ba5..5336dbe01938b1 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -1171,7 +1171,7 @@ and :c:type:`PyType_Type` effectively act as defaults.) :c:member:`~PyTypeObject.tp_weaklistoffset` field is set in a superclass. - .. c:macro:: Py_TPFLAGS_ITEMS_AT_END + .. data:: Py_TPFLAGS_ITEMS_AT_END Only usable with variable-size types, i.e. ones with non-zero :c:member:`~PyObject.tp_itemsize`. diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 58ffb1b6b31bdc..a7341559a1ea98 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -1021,7 +1021,7 @@ New Features inheriting or extending the base class size. - :c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to allow access to subclass-specific instance data. - - :c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` + - :const:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added to allow safely extending certain variable-sized types, including :c:var:`PyType_Type`. - :c:macro:`Py_RELATIVE_OFFSET` added to allow defining