Skip to content

Commit 887dee3

Browse files
committed
Doc: move Py_REFCNT and Py_SET_REFCNT from structures.rst to the reference counting page
1 parent 3378ebb commit 887dee3

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

Doc/c-api/refcounting.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,25 @@ Reference Counting
1010
The macros in this section are used for managing reference counts of Python
1111
objects.
1212

13+
.. c:function:: Py_ssize_t Py_REFCNT(PyObject *o)
14+
15+
Get the reference count of the Python object *o*.
16+
17+
Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count.
18+
19+
.. versionchanged:: 3.11
20+
The parameter type is no longer :c:expr:`const PyObject*`.
21+
22+
.. versionchanged:: 3.10
23+
:c:func:`Py_REFCNT()` is changed to the inline static function.
24+
25+
26+
.. c:function:: void Py_SET_REFCNT(PyObject *o, Py_ssize_t refcnt)
27+
28+
Set the object *o* reference counter to *refcnt*.
29+
30+
.. versionadded:: 3.9
31+
1332
1433
.. c:function:: void Py_INCREF(PyObject *o)
1534

Doc/c-api/structures.rst

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -121,26 +121,6 @@ the definition of all other Python objects.
121121
.. versionadded:: 3.9
122122
123123
124-
.. c:function:: Py_ssize_t Py_REFCNT(PyObject *o)
125-
126-
Get the reference count of the Python object *o*.
127-
128-
Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count.
129-
130-
.. versionchanged:: 3.11
131-
The parameter type is no longer :c:expr:`const PyObject*`.
132-
133-
.. versionchanged:: 3.10
134-
:c:func:`Py_REFCNT()` is changed to the inline static function.
135-
136-
137-
.. c:function:: void Py_SET_REFCNT(PyObject *o, Py_ssize_t refcnt)
138-
139-
Set the object *o* reference counter to *refcnt*.
140-
141-
.. versionadded:: 3.9
142-
143-
144124
.. c:function:: Py_ssize_t Py_SIZE(PyVarObject *o)
145125
146126
Get the size of the Python object *o*.

0 commit comments

Comments
 (0)