diff options
author | Victor Stinner <vstinner@python.org> | 2021-06-03 16:42:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-03 16:42:59 (GMT) |
commit | f3fa63ec75fdbb4a08a10957a5c631bf0c4a5970 (patch) | |
tree | 7e87d8e48debfad12ff2cd79637ca1eb03af6ca0 /Doc/c-api | |
parent | d88b47b5a396aa8d66f9a0e6b13a0825d59d0eff (diff) | |
download | cpython-f3fa63ec75fdbb4a08a10957a5c631bf0c4a5970.zip cpython-f3fa63ec75fdbb4a08a10957a5c631bf0c4a5970.tar.gz cpython-f3fa63ec75fdbb4a08a10957a5c631bf0c4a5970.tar.bz2 |
bpo-39573: Py_TYPE becomes a static inline function (GH-26493)
Convert the Py_TYPE() and Py_SIZE() macros to static inline
functions. The Py_SET_TYPE() and Py_SET_SIZE() functions must now be
used to set an object type and size.
Diffstat (limited to 'Doc/c-api')
-rw-r--r-- | Doc/c-api/structures.rst | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst index 20d5485..1a6e14e 100644 --- a/Doc/c-api/structures.rst +++ b/Doc/c-api/structures.rst @@ -99,7 +99,10 @@ the definition of all other Python objects. Return a :term:`borrowed reference`. - The :c:func:`Py_SET_TYPE` function must be used to set an object type. + Use the :c:func:`Py_SET_TYPE` function to set an object type. + + .. versionchanged:: 3.11 + :c:func:`Py_TYPE()` is changed to an inline static function. .. c:function:: int Py_IS_TYPE(PyObject *o, PyTypeObject *type) @@ -121,9 +124,10 @@ the definition of all other Python objects. Get the reference count of the Python object *o*. + Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count. + .. versionchanged:: 3.10 :c:func:`Py_REFCNT()` is changed to the inline static function. - Use :c:func:`Py_SET_REFCNT()` to set an object reference count. .. c:function:: void Py_SET_REFCNT(PyObject *o, Py_ssize_t refcnt) @@ -137,7 +141,10 @@ the definition of all other Python objects. Get the size of the Python object *o*. - The :c:func:`Py_SET_SIZE` function must be used to set an object size. + Use the :c:func:`Py_SET_SIZE` function to set an object size. + + .. versionchanged:: 3.11 + :c:func:`Py_SIZE()` is changed to an inline static function. .. c:function:: void Py_SET_SIZE(PyVarObject *o, Py_ssize_t size) |