diff options
Diffstat (limited to 'Doc/c-api/structures.rst')
-rw-r--r-- | Doc/c-api/structures.rst | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst index 5535f42ac1..b2392fa5e1 100644 --- a/Doc/c-api/structures.rst +++ b/Doc/c-api/structures.rst @@ -88,13 +88,13 @@ the definition of all other Python objects. .. versionadded:: 3.9 -.. c:macro:: Py_REFCNT(o) +.. c:function:: Py_ssize_t Py_REFCNT(const PyObject *o) - This macro is used to access the :attr:`ob_refcnt` member of a Python - object. - It expands to:: + Get the reference count of the Python object *o*. - (((PyObject*)(o))->ob_refcnt) + .. 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) @@ -104,12 +104,13 @@ the definition of all other Python objects. .. versionadded:: 3.9 -.. c:macro:: Py_SIZE(o) +.. c:function:: Py_ssize_t Py_SIZE(const PyVarObject *o) - This macro is used to access the :attr:`ob_size` member of a Python object. - It expands to:: + Get the size of the Python object *o*. - (((PyVarObject*)(o))->ob_size) + .. versionchanged:: 3.10 + :c:func:`Py_SIZE()` is changed to the inline static function. + Use :c:func:`Py_SET_SIZE()` to set an object size. .. c:function:: void Py_SET_SIZE(PyVarObject *o, Py_ssize_t size) |