Skip to content

Commit fad72d0

Browse files
gh-91755: Document Py_IncRef and Py_DecRef as C functions (GH-91805)
Co-authored-by: Erlend Egeberg Aasland <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]> (cherry picked from commit 58a3d28) Co-authored-by: Charlie Zhao <[email protected]>
1 parent 9a61afe commit fad72d0

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Diff for: Doc/c-api/refcounting.rst

+10-4
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,17 @@ objects.
109109
It is a good idea to use this macro whenever decrementing the reference
110110
count of an object that might be traversed during garbage collection.
111111
112+
.. c:function:: void Py_IncRef(PyObject *o)
113+
114+
Increment the reference count for object *o*. A function version of :c:func:`Py_XINCREF`.
115+
It can be used for runtime dynamic embedding of Python.
116+
117+
118+
.. c:function:: void Py_DecRef(PyObject *o)
119+
120+
Decrement the reference count for object *o*. A function version of :c:func:`Py_XDECREF`.
121+
It can be used for runtime dynamic embedding of Python.
112122
113-
The following functions are for runtime dynamic embedding of Python:
114-
``Py_IncRef(PyObject *o)``, ``Py_DecRef(PyObject *o)``. They are
115-
simply exported function versions of :c:func:`Py_XINCREF` and
116-
:c:func:`Py_XDECREF`, respectively.
117123
118124
The following functions or macros are only for use within the interpreter core:
119125
:c:func:`_Py_Dealloc`, :c:func:`_Py_ForgetReference`, :c:func:`_Py_NewReference`,

0 commit comments

Comments
 (0)