Skip to content

Commit ad6c98c

Browse files
committed
Try to clarify that this is a breaking change in Python 3.14.
1 parent b807f77 commit ad6c98c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Doc/whatsnew/3.14.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3047,11 +3047,15 @@ Porting to Python 3.14
30473047
loading objects onto the operands stack by :term:`borrowing <borrowed reference>`
30483048
references when possible. This can lead to smaller reference count values
30493049
compared to previous Python versions, because the creation of :term:`strong
3050-
references <strong reference>` is avoided in the Python interpreter. This
3051-
generally does not affect existing code, but C API extensions that checked
3052-
:c:func:`Py_REFCNT` of ``1`` to determine if an object is not referenced by
3053-
any other code should instead use :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary`
3054-
as a safer replacement.
3050+
references <strong reference>` is avoided in the Python interpreter.
3051+
3052+
This means that in Python 3.14, the :term:`reference count` of an object can
3053+
be ``1`` even when an object has more than one reference in the interpreter
3054+
stack. This generally does not affect existing code, but C API extensions
3055+
that checked :c:func:`Py_REFCNT` of ``1`` to determine if an object is not
3056+
referenced by any other code should instead use
3057+
:c:func:`PyUnstable_Object_IsUniqueReferencedTemporary` as a safer
3058+
replacement.
30553059

30563060

30573061
* Private functions promoted to public C APIs:

0 commit comments

Comments
 (0)