Skip to content

Commit ee1f95b

Browse files
committed
Improve 3.14 whatsnew about reference counting changes.
1 parent 35a8494 commit ee1f95b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Doc/whatsnew/3.14.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3046,10 +3046,12 @@ Porting to Python 3.14
30463046
* The interpreter internally avoids some reference count modifications when
30473047
loading objects onto the operands stack by :term:`borrowing <borrowed reference>`
30483048
references when possible. This can lead to smaller reference count values
3049-
compared to previous Python versions. C API extensions that checked
3050-
:c:func:`Py_REFCNT` of ``1`` to determine if an function argument is not
3051-
referenced by any other code should instead use
3052-
:c:func:`PyUnstable_Object_IsUniqueReferencedTemporary` as a safer replacement.
3049+
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.
30533055

30543056

30553057
* Private functions promoted to public C APIs:

0 commit comments

Comments
 (0)