Skip to content

Commit 35a8494

Browse files
committed
Improve the Py_REFCNT() documentation for 3.14.
1 parent 75d20b2 commit 35a8494

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Doc/c-api/refcounting.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ of Python objects.
1919
references to the object are actually held. For example, some
2020
objects are :term:`immortal` and have a very high refcount that does not
2121
reflect the actual number of references. Consequently, do not rely
22-
on the returned value to be accurate, other than a value of 0 or 1.
22+
on the returned value to be accurate.
2323
2424
Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count.
2525
@@ -38,6 +38,12 @@ of Python objects.
3838
.. versionchanged:: 3.11
3939
The parameter type is no longer :c:expr:`const PyObject*`.
4040
41+
.. versionchanged:: 3.14
42+
The interpreter now uses :term:`borrowed references <borrowed reference>`
43+
where possible when calling C extensions. This means that an object's
44+
reference count may appear as 1, even when it is not solely referenced by
45+
the caller.
46+
4147
4248
.. c:function:: void Py_SET_REFCNT(PyObject *o, Py_ssize_t refcnt)
4349

0 commit comments

Comments
 (0)