aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Doc/c-api/refcounting.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/c-api/refcounting.rst')
-rw-r--r--Doc/c-api/refcounting.rst11
1 files changed, 9 insertions, 2 deletions
diff --git a/Doc/c-api/refcounting.rst b/Doc/c-api/refcounting.rst
index 83febcf70a5..57a0728d4e9 100644
--- a/Doc/c-api/refcounting.rst
+++ b/Doc/c-api/refcounting.rst
@@ -23,7 +23,14 @@ of Python objects.
Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count.
- See also the function :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary()`.
+ .. note::
+
+ On :term:`free threaded <free threading>` builds of Python, returning 1
+ isn't sufficient to determine if it's safe to treat *o* as having no
+ access by other threads. Use :c:func:`PyUnstable_Object_IsUniquelyReferenced`
+ for that instead.
+
+ See also the function :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary()`.
.. versionchanged:: 3.10
:c:func:`Py_REFCNT()` is changed to the inline static function.
@@ -203,7 +210,7 @@ of Python objects.
Py_SETREF(dst, src);
- That arranges to set *dst* to *src* _before_ releasing the reference
+ That arranges to set *dst* to *src* *before* releasing the reference
to the old value of *dst*, so that any code triggered as a side-effect
of *dst* getting torn down no longer believes *dst* points
to a valid object.