Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Doc/deprecations/c-api-pending-removal-in-future.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ although there is currently no date scheduled for their removal.
Use :c:func:`!_PyErr_ChainExceptions1` instead.
* :c:member:`!PyBytesObject.ob_shash` member:
call :c:func:`PyObject_Hash` instead.
* :c:member:`!PyDictObject.ma_version_tag` member.
* Thread Local Storage (TLS) API:

* :c:func:`PyThread_create_key`:
Expand Down
56 changes: 32 additions & 24 deletions Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1218,16 +1218,6 @@ New features
which has an ambiguous return value.
(Contributed by Irit Katriel and Erlend Aasland in :gh:`105201`.)

* :c:func:`Py_Finalize` now deletes all interned strings. This
is backwards incompatible to any C-Extension that holds onto an interned
string after a call to :c:func:`Py_Finalize` and is then reused after a
call to :c:func:`Py_Initialize`. Any issues arising from this behavior will
normally result in crashes during the execution of the subsequent call to
:c:func:`Py_Initialize` from accessing uninitialized memory. To fix, use
an address sanitizer to identify any use-after-free coming from
an interned string and deallocate it during module shutdown.
(Contributed by Eddie Elizondo in :gh:`113601`.)

* Add :c:func:`PyLong_IsPositive`, :c:func:`PyLong_IsNegative`
and :c:func:`PyLong_IsZero` for checking if :c:type:`PyLongObject`
is positive, negative, or zero, respectively.
Expand Down Expand Up @@ -1303,18 +1293,12 @@ New features
test if two strings are equal.
(Contributed by Victor Stinner in :gh:`124502`.)


* Add :c:func:`PyType_Freeze` function to make a type immutable.
(Contributed by Victor Stinner in :gh:`121654`.)

* Add :c:func:`PyUnstable_Object_EnableDeferredRefcount` for enabling
deferred reference counting, as outlined in :pep:`703`.

* The :ref:`Unicode Exception Objects <unicodeexceptions>` C API
now raises a :exc:`TypeError` if its exception argument is not
a :exc:`UnicodeError` object.
(Contributed by Bénédikt Tran in :gh:`127691`.)

* Add :c:func:`PyMonitoring_FireBranchLeftEvent` and
:c:func:`PyMonitoring_FireBranchRightEvent` for generating
:monitoring-event:`BRANCH_LEFT` and :monitoring-event:`BRANCH_RIGHT`
Expand All @@ -1331,14 +1315,33 @@ New features
(Contributed by Petr Viktorin in :gh:`128629`.)


Porting to Python 3.14
----------------------
Limited C API changes
---------------------

* In the limited C API 3.14 and newer, :c:func:`Py_TYPE` and
:c:func:`Py_REFCNT` are now implemented as an opaque function call to hide
implementation details.
(Contributed by Victor Stinner in :gh:`120600` and :gh:`124127`.)


Porting to Python 3.14
----------------------

* :c:func:`Py_Finalize` now deletes all interned strings. This
is backwards incompatible to any C-Extension that holds onto an interned
string after a call to :c:func:`Py_Finalize` and is then reused after a
call to :c:func:`Py_Initialize`. Any issues arising from this behavior will
normally result in crashes during the execution of the subsequent call to
:c:func:`Py_Initialize` from accessing uninitialized memory. To fix, use
an address sanitizer to identify any use-after-free coming from
an interned string and deallocate it during module shutdown.
(Contributed by Eddie Elizondo in :gh:`113601`.)

* The :ref:`Unicode Exception Objects <unicodeexceptions>` C API
now raises a :exc:`TypeError` if its exception argument is not
a :exc:`UnicodeError` object.
(Contributed by Bénédikt Tran in :gh:`127691`.)

* Private functions promoted to public C APIs:

* ``_PyBytes_Join()``: :c:func:`PyBytes_Join`;
Expand Down Expand Up @@ -1383,12 +1386,6 @@ Deprecated

.. Add C API deprecations above alphabetically, not here at the end.

.. include:: ../deprecations/c-api-pending-removal-in-3.15.rst

.. include:: ../deprecations/c-api-pending-removal-in-3.18.rst

.. include:: ../deprecations/c-api-pending-removal-in-future.rst

* The ``PyMonitoring_FireBranchEvent`` function is deprecated and should
be replaced with calls to :c:func:`PyMonitoring_FireBranchLeftEvent`
and :c:func:`PyMonitoring_FireBranchRightEvent`.
Expand All @@ -1413,12 +1410,23 @@ Deprecated
(Contributed by Victor Stinner in :gh:`128863`.)


.. include:: ../deprecations/c-api-pending-removal-in-3.15.rst

.. include:: ../deprecations/c-api-pending-removal-in-3.18.rst

.. include:: ../deprecations/c-api-pending-removal-in-future.rst


Removed
-------

* Creating :c:data:`immutable types <Py_TPFLAGS_IMMUTABLETYPE>` with mutable
bases was deprecated since 3.12 and now raises a :exc:`TypeError`.

* Remove ``PyDictObject.ma_version_tag`` member which was deprecated since
Python 3.12. Use the :c:func:`PyDict_AddWatcher` API instead.
(Contributed by Sam Gross in :gh:`124296`.)

* Remove the private ``_Py_InitializeMain()`` function. It was a
:term:`provisional API` added to Python 3.8 by :pep:`587`.
(Contributed by Victor Stinner in :gh:`129033`.)
Loading