diff options
author | Victor Stinner <vstinner@python.org> | 2020-02-07 00:24:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-07 00:24:29 (GMT) |
commit | c86a11221df7e37da389f9c6ce6e47ea22dc44ff (patch) | |
tree | c27a35a01bde1554488268dd3bbeb8b4c46e193c /Doc/c-api | |
parent | a93c51e3a8e15f1a486d11d5b55a64f3381babe0 (diff) | |
download | cpython-c86a11221df7e37da389f9c6ce6e47ea22dc44ff.zip cpython-c86a11221df7e37da389f9c6ce6e47ea22dc44ff.tar.gz cpython-c86a11221df7e37da389f9c6ce6e47ea22dc44ff.tar.bz2 |
bpo-39573: Add Py_SET_REFCNT() function (GH-18389)
Add a Py_SET_REFCNT() function to set the reference counter of an
object.
Diffstat (limited to 'Doc/c-api')
-rw-r--r-- | Doc/c-api/structures.rst | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst index 0c66138..100573c 100644 --- a/Doc/c-api/structures.rst +++ b/Doc/c-api/structures.rst @@ -79,6 +79,13 @@ the definition of all other Python objects. (((PyObject*)(o))->ob_refcnt) +.. c:function:: void Py_SET_REFCNT(PyObject *o, Py_ssize_t refcnt) + + Set the object *o* reference counter to *refcnt*. + + .. versionadded:: 3.9 + + .. c:macro:: Py_SIZE(o) This macro is used to access the :attr:`ob_size` member of a Python object. |