aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Doc/whatsnew
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r--Doc/whatsnew/2.6.rst2
-rw-r--r--Doc/whatsnew/3.0.rst2
-rw-r--r--Doc/whatsnew/3.10.rst13
-rw-r--r--Doc/whatsnew/3.13.rst37
-rw-r--r--Doc/whatsnew/3.14.rst147
-rw-r--r--Doc/whatsnew/3.15.rst247
-rw-r--r--Doc/whatsnew/3.3.rst2
-rw-r--r--Doc/whatsnew/3.8.rst4
8 files changed, 400 insertions, 54 deletions
diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst
index 9dbc07a34e2..0803eba99e6 100644
--- a/Doc/whatsnew/2.6.rst
+++ b/Doc/whatsnew/2.6.rst
@@ -3043,7 +3043,7 @@ Changes to Python's build process and to the C API include:
* Importing modules simultaneously in two different threads no longer
deadlocks; it will now raise an :exc:`ImportError`. A new API
- function, :c:func:`PyImport_ImportModuleNoBlock`, will look for a
+ function, :c:func:`!PyImport_ImportModuleNoBlock`, will look for a
module in ``sys.modules`` first, then try to import it after
acquiring an import lock. If the import lock is held by another
thread, an :exc:`ImportError` is raised.
diff --git a/Doc/whatsnew/3.0.rst b/Doc/whatsnew/3.0.rst
index 6e1fda22ed2..d858586138e 100644
--- a/Doc/whatsnew/3.0.rst
+++ b/Doc/whatsnew/3.0.rst
@@ -870,7 +870,7 @@ to the C API.
* :c:func:`!PyNumber_Coerce`, :c:func:`!PyNumber_CoerceEx`,
:c:func:`!PyMember_Get`, and :c:func:`!PyMember_Set` C APIs are removed.
-* New C API :c:func:`PyImport_ImportModuleNoBlock`, works like
+* New C API :c:func:`!PyImport_ImportModuleNoBlock`, works like
:c:func:`PyImport_ImportModule` but won't block on the import lock
(returning an error instead).
diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst
index 3c815721a92..1067601c652 100644
--- a/Doc/whatsnew/3.10.rst
+++ b/Doc/whatsnew/3.10.rst
@@ -551,11 +551,12 @@ Patterns and classes
If you are using classes to structure your data, you can use as a pattern
the class name followed by an argument list resembling a constructor. This
-pattern has the ability to capture class attributes into variables::
+pattern has the ability to capture instance attributes into variables::
class Point:
- x: int
- y: int
+ def __init__(self, x, y):
+ self.x = x
+ self.y = y
def location(point):
match point:
@@ -2176,9 +2177,9 @@ Porting to Python 3.10
``unicodedata.ucnhash_CAPI`` has been moved to the internal C API.
(Contributed by Victor Stinner in :issue:`42157`.)
-* :c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`,
- :c:func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome` and
- :c:func:`Py_GetProgramName` functions now return ``NULL`` if called before
+* :c:func:`!Py_GetPath`, :c:func:`!Py_GetPrefix`, :c:func:`!Py_GetExecPrefix`,
+ :c:func:`!Py_GetProgramFullPath`, :c:func:`!Py_GetPythonHome` and
+ :c:func:`!Py_GetProgramName` functions now return ``NULL`` if called before
:c:func:`Py_Initialize` (before Python is initialized). Use the new
:ref:`init-config` API to get the :ref:`init-path-config`.
(Contributed by Victor Stinner in :issue:`42260`.)
diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst
index e20e49325c0..580a3d8154d 100644
--- a/Doc/whatsnew/3.13.rst
+++ b/Doc/whatsnew/3.13.rst
@@ -730,6 +730,22 @@ asyncio
never awaited).
(Contributed by Arthur Tacca and Jason Zhang in :gh:`115957`.)
+* The function and methods named ``create_task`` have received a new
+ ``**kwargs`` argument that is passed through to the task constructor.
+ This change was accidentally added in 3.13.3,
+ and broke the API contract for custom task factories.
+ Several third-party task factories implemented workarounds for this.
+ In 3.13.4 and later releases the old factory contract is honored
+ once again (until 3.14).
+ To keep the workarounds working, the extra ``**kwargs`` argument still
+ allows passing additional keyword arguments to :class:`~asyncio.Task`
+ and to custom task factories.
+
+ This affects the following function and methods:
+ :meth:`asyncio.create_task`,
+ :meth:`asyncio.loop.create_task`,
+ :meth:`asyncio.TaskGroup.create_task`.
+ (Contributed by Thomas Grainger in :gh:`128307`.)
base64
------
@@ -1871,7 +1887,7 @@ New Deprecations
* :mod:`http.server`:
- * Deprecate :class:`~http.server.CGIHTTPRequestHandler`,
+ * Deprecate :class:`!CGIHTTPRequestHandler`,
to be removed in Python 3.15.
Process-based CGI HTTP servers have been out of favor for a very long time.
This code was outdated, unmaintained, and rarely used.
@@ -1908,7 +1924,7 @@ New Deprecations
* :mod:`platform`:
- * Deprecate :func:`~platform.java_ver`,
+ * Deprecate :func:`!platform.java_ver`,
to be removed in Python 3.15.
This function is only useful for Jython support, has a confusing API,
and is largely untested.
@@ -1995,8 +2011,7 @@ New Deprecations
* :mod:`wave`:
- * Deprecate the :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`,
- and :meth:`~wave.Wave_read.getmarkers` methods of
+ * Deprecate the ``getmark()``, ``setmark()`` and ``getmarkers()`` methods of
the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes,
to be removed in Python 3.15.
(Contributed by Victor Stinner in :gh:`105096`.)
@@ -2477,17 +2492,17 @@ Deprecated C APIs
* :c:func:`PySys_ResetWarnOptions`:
Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead.
- * :c:func:`Py_GetExecPrefix`:
+ * :c:func:`!Py_GetExecPrefix`:
Get :data:`sys.exec_prefix` instead.
- * :c:func:`Py_GetPath`:
+ * :c:func:`!Py_GetPath`:
Get :data:`sys.path` instead.
- * :c:func:`Py_GetPrefix`:
+ * :c:func:`!Py_GetPrefix`:
Get :data:`sys.prefix` instead.
- * :c:func:`Py_GetProgramFullPath`:
+ * :c:func:`!Py_GetProgramFullPath`:
Get :data:`sys.executable` instead.
- * :c:func:`Py_GetProgramName`:
+ * :c:func:`!Py_GetProgramName`:
Get :data:`sys.executable` instead.
- * :c:func:`Py_GetPythonHome`:
+ * :c:func:`!Py_GetPythonHome`:
Get :c:member:`PyConfig.home`
or the :envvar:`PYTHONHOME` environment variable instead.
@@ -2499,7 +2514,7 @@ Deprecated C APIs
which return a :term:`borrowed reference`.
(Soft deprecated as part of :pep:`667`.)
-* Deprecate the :c:func:`PyImport_ImportModuleNoBlock` function,
+* Deprecate the :c:func:`!PyImport_ImportModuleNoBlock` function,
which is just an alias to :c:func:`PyImport_ImportModule` since Python 3.3.
(Contributed by Victor Stinner in :gh:`105396`.)
diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst
index 894f011ec86..45e68aea5fb 100644
--- a/Doc/whatsnew/3.14.rst
+++ b/Doc/whatsnew/3.14.rst
@@ -74,7 +74,7 @@ deferred evaluation of annotations (:pep:`649`),
and a new type of interpreter that uses tail calls.
The library changes include the addition of a new :mod:`!annotationlib` module
-for introspecting and wrapping annotations (:pep:`649`),
+for introspecting and wrapping annotations (:pep:`749`),
a new :mod:`!compression.zstd` module for Zstandard support (:pep:`784`),
plus syntax highlighting in the REPL,
as well as the usual deprecations and removals,
@@ -82,12 +82,13 @@ and improvements in user-friendliness and correctness.
.. PEP-sized items next.
-* :ref:`PEP 649: deferred evaluation of annotations <whatsnew314-pep649>`
+* :ref:`PEP 649 and 749: deferred evaluation of annotations <whatsnew314-pep649>`
* :ref:`PEP 741: Python Configuration C API <whatsnew314-pep741>`
* :ref:`PEP 750: Template strings <whatsnew314-pep750>`
* :ref:`PEP 758: Allow except and except* expressions without parentheses <whatsnew314-pep758>`
* :ref:`PEP 761: Discontinuation of PGP signatures <whatsnew314-pep761>`
* :ref:`PEP 765: Disallow return/break/continue that exit a finally block <whatsnew314-pep765>`
+* :ref:`Free-threaded mode improvements <whatsnew314-free-threaded-cpython>`
* :ref:`PEP 768: Safe external debugger interface for CPython <whatsnew314-pep768>`
* :ref:`PEP 784: Adding Zstandard to the standard library <whatsnew314-pep784>`
* :ref:`A new type of interpreter <whatsnew314-tail-call>`
@@ -153,10 +154,10 @@ As another example, generating HTML attributes from data:
.. code-block:: python
attributes = {"src": "shrubbery.jpg", "alt": "looks nice"}
- template = t"<img {attributes} />"
- assert html(template) == '<img src="shrubbery.jpg" alt="looks nice" class="looks-nice" />'
+ template = t"<img {attributes}>"
+ assert html(template) == '<img src="shrubbery.jpg" alt="looks nice" class="looks-nice">'
-Unlike f-strings, the ``html`` function has access to template attributes
+Compared to using an f-string, the ``html`` function has access to template attributes
containing the original information: static strings, interpolations, and values
from the original scope. Unlike existing templating approaches, t-strings build
from the well-known f-string syntax and rules. Template systems thus benefit
@@ -341,15 +342,16 @@ For example the following expressions are now valid:
.. code-block:: python
try:
- release_new_sleep_token_album()
- except AlbumNotFound, SongsTooGoodToBeReleased:
- print("Sorry, no new album this year.")
+ connect_to_server()
+ except TimeoutError, ConnectionRefusedError:
+ print("Network issue encountered.")
# The same applies to except* (for exception groups):
+
try:
- release_new_sleep_token_album()
- except* AlbumNotFound, SongsTooGoodToBeReleased:
- print("Sorry, no new album this year.")
+ connect_to_server()
+ except* TimeoutError, ConnectionRefusedError:
+ print("Network issue encountered.")
Check :pep:`758` for more details.
@@ -361,18 +363,19 @@ Check :pep:`758` for more details.
.. _whatsnew314-pep649:
-PEP 649: deferred evaluation of annotations
--------------------------------------------
+PEP 649 and 749: deferred evaluation of annotations
+---------------------------------------------------
The :term:`annotations <annotation>` on functions, classes, and modules are no
longer evaluated eagerly. Instead, annotations are stored in special-purpose
:term:`annotate functions <annotate function>` and evaluated only when
-necessary. This is specified in :pep:`649` and :pep:`749`.
+necessary (except if ``from __future__ import annotations`` is used).
+This is specified in :pep:`649` and :pep:`749`.
This change is designed to make annotations in Python more performant and more
usable in most circumstances. The runtime cost for defining annotations is
minimized, but it remains possible to introspect annotations at runtime.
-It is usually no longer necessary to enclose annotations in strings if they
+It is no longer necessary to enclose annotations in strings if they
contain forward references.
The new :mod:`annotationlib` module provides tools for inspecting deferred
@@ -408,7 +411,8 @@ writing annotations the same way you did with previous versions of Python.
You will likely be able to remove quoted strings in annotations, which are frequently
used for forward references. Similarly, if you use ``from __future__ import annotations``
to avoid having to write strings in annotations, you may well be able to
-remove that import. However, if you rely on third-party libraries that read annotations,
+remove that import once you support only Python 3.14 and newer.
+However, if you rely on third-party libraries that read annotations,
those libraries may need changes to support unquoted annotations before they
work as expected.
@@ -421,6 +425,11 @@ annotations. For example, you may want to use :func:`annotationlib.get_annotatio
with the :attr:`~annotationlib.Format.FORWARDREF` format, as the :mod:`dataclasses`
module now does.
+The external :pypi:`typing_extensions` package provides partial backports of some of the
+functionality of the :mod:`annotationlib` module, such as the :class:`~annotationlib.Format`
+enum and the :func:`~annotationlib.get_annotations` function. These can be used to
+write cross-version code that takes advantage of the new behavior in Python 3.14.
+
Related changes
^^^^^^^^^^^^^^^
@@ -432,6 +441,14 @@ functions in the standard library, there are many ways in which your code may
not work in Python 3.14. To safeguard your code against future changes,
use only the documented functionality of the :mod:`annotationlib` module.
+In particular, do not read annotations directly from the namespace dictionary
+attribute of type objects. Use :func:`annotationlib.get_annotate_from_class_namespace`
+during class construction and :func:`annotationlib.get_annotations` afterwards.
+
+In previous releases, it was sometimes possible to access class annotations from
+an instance of an annotated class. This behavior was undocumented and accidental,
+and will no longer work in Python 3.14.
+
``from __future__ import annotations``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -443,6 +460,11 @@ Python without deferred evaluation of annotations, reaches its end of life in 20
In Python 3.14, the behavior of code using ``from __future__ import annotations``
is unchanged.
+(Contributed by Jelle Zijlstra in :gh:`119180`; :pep:`649` was written by Larry Hastings.)
+
+.. seealso::
+ :pep:`649` and :pep:`749`.
+
Improved error messages
-----------------------
@@ -584,8 +606,27 @@ Improved error messages
^^^^^^
SyntaxError: cannot use subscript as import target
-.. seealso::
- :pep:`649`.
+* Improved error message when trying to add an instance of an unhashable type to
+ a :class:`dict` or :class:`set`. (Contributed by CF Bolz-Tereick and Victor Stinner
+ in :gh:`132828`.)
+
+ .. code-block:: pycon
+
+ >>> s = set()
+ >>> s.add({'pages': 12, 'grade': 'A'})
+ Traceback (most recent call last):
+ File "<python-input-1>", line 1, in <module>
+ s.add({'pages': 12, 'grade': 'A'})
+ ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ TypeError: cannot use 'dict' as a set element (unhashable type: 'dict')
+ >>> d = {}
+ >>> l = [1, 2, 3]
+ >>> d[l] = 12
+ Traceback (most recent call last):
+ File "<python-input-4>", line 1, in <module>
+ d[l] = 12
+ ~^^^
+ TypeError: cannot use 'list' as a dict key (unhashable type: 'list')
.. _whatsnew314-pep741:
@@ -772,6 +813,33 @@ For further information on how to build Python, see
(Contributed by Ken Jin in :gh:`128563`, with ideas on how to implement this
in CPython by Mark Shannon, Garrett Gu, Haoran Xu, and Josh Haberman.)
+.. _whatsnew314-free-threaded-cpython:
+
+Free-threaded mode
+------------------
+
+Free-threaded mode (:pep:`703`), initially added in 3.13, has been significantly improved.
+The implementation described in PEP 703 was finished, including C API changes,
+and temporary workarounds in the interpreter were replaced with more permanent solutions.
+The specializing adaptive interpreter (:pep:`659`) is now enabled in free-threaded mode,
+which along with many other optimizations greatly improves its performance.
+The performance penalty on single-threaded code in free-threaded mode is now roughly 5-10%,
+depending on platform and C compiler used.
+
+This work was done by many contributors: Sam Gross, Matt Page, Neil Schemenauer,
+Thomas Wouters, Donghee Na, Kirill Podoprigora, Ken Jin, Itamar Oren,
+Brett Simmers, Dino Viehland, Nathan Goldbaum, Ralf Gommers, Lysandros Nikolaou,
+Kumar Aditya, Edgar Margffoy, and many others.
+
+Some of these contributors are employed by Meta, which has continued to provide
+significant engineering resources to support this project.
+
+From 3.14, when compiling extension modules for the free-threaded build of
+CPython on Windows, the preprocessor variable ``Py_GIL_DISABLED`` now needs to
+be specified by the build backend, as it will no longer be determined
+automatically by the C compiler. For a running interpreter, the setting that
+was used at compile time can be found using :func:`sysconfig.get_config_var`.
+
.. _whatsnew314-pyrepl-highlighting:
@@ -1001,6 +1069,24 @@ ast
(Contributed by Semyon Moroz in :gh:`133367`.)
+asyncio
+-------
+
+* The function and methods named :func:`!create_task` now take an arbitrary
+ list of keyword arguments. All keyword arguments are passed to the
+ :class:`~asyncio.Task` constructor or the custom task factory.
+ (See :meth:`~asyncio.loop.set_task_factory` for details.)
+ The ``name`` and ``context`` keyword arguments are no longer special;
+ the name should now be set using the ``name`` keyword argument of the factory,
+ and ``context`` may be ``None``.
+
+ This affects the following function and methods:
+ :meth:`asyncio.create_task`,
+ :meth:`asyncio.loop.create_task`,
+ :meth:`asyncio.TaskGroup.create_task`.
+ (Contributed by Thomas Grainger in :gh:`128307`.)
+
+
bdb
---
@@ -1119,6 +1205,9 @@ ctypes
making it a :term:`generic type`.
(Contributed by Brian Schubert in :gh:`132168`.)
+* :mod:`ctypes` now supports :term:`free-threading builds <free threading>`.
+ (Contributed by Kumar Aditya and Peter Bierma in :gh:`127945`.)
+
curses
------
@@ -1366,7 +1455,7 @@ math
----
* Added more detailed error messages for domain errors in the module.
- (Contributed by by Charlie Zhao and Sergey B Kirpichev in :gh:`101410`.)
+ (Contributed by Charlie Zhao and Sergey B Kirpichev in :gh:`101410`.)
mimetypes
@@ -1916,11 +2005,19 @@ Optimizations
asyncio
-------
-* :mod:`asyncio` now uses double linked list implementation for native tasks
- which speeds up execution by 10% on standard pyperformance benchmarks and
- reduces memory usage.
+* :mod:`asyncio` has a new per-thread double linked list implementation internally for
+ :class:`native tasks <asyncio.Task>` which speeds up execution by 10-20% on standard
+ pyperformance benchmarks and reduces memory usage.
+ This enables external introspection tools such as
+ :ref:`python -m asyncio pstree <whatsnew314-asyncio-introspection>`
+ to introspect the call graph of asyncio tasks running in all threads.
(Contributed by Kumar Aditya in :gh:`107803`.)
+* :mod:`asyncio` has first class support for :term:`free-threading builds <free threading>`.
+ This enables parallel execution of multiple event loops across different threads and scales
+ linearly with the number of threads.
+ (Contributed by Kumar Aditya in :gh:`128002`.)
+
* :mod:`asyncio` has new utility functions for introspecting and printing
the program's call graph: :func:`asyncio.capture_call_graph` and
:func:`asyncio.print_call_graph`.
@@ -2002,7 +2099,6 @@ Deprecated
* :class:`asyncio.WindowsProactorEventLoopPolicy`
* :func:`asyncio.get_event_loop_policy`
* :func:`asyncio.set_event_loop_policy`
- * :func:`asyncio.set_event_loop`
Users should use :func:`asyncio.run` or :class:`asyncio.Runner` with
*loop_factory* to use the desired event loop implementation.
@@ -2410,6 +2506,11 @@ Changes in the Python API
See :ref:`above <whatsnew314-typing-union>` for more details.
(Contributed by Jelle Zijlstra in :gh:`105499`.)
+* The runtime behavior of annotations has changed in various ways; see
+ :ref:`above <whatsnew314-pep649>` for details. While most code that interacts
+ with annotations should continue to work, some undocumented details may behave
+ differently.
+
Build changes
=============
diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst
index 5e9922069aa..daf3e8fb6c2 100644
--- a/Doc/whatsnew/3.15.rst
+++ b/Doc/whatsnew/3.15.rst
@@ -75,6 +75,9 @@ New features
Other language changes
======================
+* Several error messages incorrectly using the term "argument" have been corrected.
+ (Contributed by Stan Ulbrych in :gh:`133382`.)
+
New modules
@@ -86,10 +89,90 @@ New modules
Improved modules
================
-module_name
------------
+dbm
+---
+
+* Added new :meth:`!reorganize` methods to :mod:`dbm.dumb` and :mod:`dbm.sqlite3`
+ which allow to recover unused free space previously occupied by deleted entries.
+ (Contributed by Andrea Oliveri in :gh:`134004`.)
+
+* Add the ``'m'`` flag for :func:`dbm.gnu.open` which allows to disable
+ the use of :manpage:`mmap(2)`.
+ This may harm performance, but improve crash tolerance.
+ (Contributed by Serhiy Storchaka in :gh:`66234`.)
+
+difflib
+-------
+
+* Improved the styling of HTML diff pages generated by the :class:`difflib.HtmlDiff`
+ class, and migrated the output to the HTML5 standard.
+ (Contributed by Jiahao Li in :gh:`134580`.)
+
+
+math
+----
+
+* Add :func:`math.isnormal` and :func:`math.issubnormal` functions.
+ (Contributed by Sergey B Kirpichev in :gh:`132908`.)
+
+
+os.path
+-------
+
+* The *strict* parameter to :func:`os.path.realpath` accepts a new value,
+ :data:`os.path.ALLOW_MISSING`.
+ If used, errors other than :exc:`FileNotFoundError` will be re-raised;
+ the resulting path can be missing but it will be free of symlinks.
+ (Contributed by Petr Viktorin for :cve:`2025-4517`.)
+
+
+shelve
+------
+
+* Added new :meth:`!reorganize` method to :mod:`shelve` used to recover unused free
+ space previously occupied by deleted entries.
+ (Contributed by Andrea Oliveri in :gh:`134004`.)
+
+
+ssl
+---
+
+* Indicate through :data:`ssl.HAS_PSK_TLS13` whether the :mod:`ssl` module
+ supports "External PSKs" in TLSv1.3, as described in RFC 9258.
+ (Contributed by Will Childs-Klein in :gh:`133624`.)
+
+
+tarfile
+-------
+
+* :func:`~tarfile.data_filter` now normalizes symbolic link targets in order to
+ avoid path traversal attacks.
+ (Contributed by Petr Viktorin in :gh:`127987` and :cve:`2025-4138`.)
+* :func:`~tarfile.TarFile.extractall` now skips fixing up directory attributes
+ when a directory was removed or replaced by another kind of file.
+ (Contributed by Petr Viktorin in :gh:`127987` and :cve:`2024-12718`.)
+* :func:`~tarfile.TarFile.extract` and :func:`~tarfile.TarFile.extractall`
+ now (re-)apply the extraction filter when substituting a link (hard or
+ symbolic) with a copy of another archive member, and when fixing up
+ directory attributes.
+ The former raises a new exception, :exc:`~tarfile.LinkFallbackError`.
+ (Contributed by Petr Viktorin for :cve:`2025-4330` and :cve:`2024-12718`.)
+* :func:`~tarfile.TarFile.extract` and :func:`~tarfile.TarFile.extractall`
+ no longer extract rejected members when
+ :func:`~tarfile.TarFile.errorlevel` is zero.
+ (Contributed by Matt Prodani and Petr Viktorin in :gh:`112887`
+ and :cve:`2025-4435`.)
+
+
+zlib
+----
+
+* Allow combining two Adler-32 checksums via :func:`~zlib.adler32_combine`.
+ (Contributed by Callum Attryde and Bénédikt Tran in :gh:`134635`.)
+
+* Allow combining two CRC-32 checksums via :func:`~zlib.crc32_combine`.
+ (Contributed by Bénédikt Tran in :gh:`134635`.)
-* TODO
.. Add improved modules above alphabetically, not here at the end.
@@ -106,8 +189,20 @@ module_name
Deprecated
==========
-* module_name:
- TODO
+hashlib
+-------
+
+* In hash function constructors such as :func:`~hashlib.new` or the
+ direct hash-named constructors such as :func:`~hashlib.md5` and
+ :func:`~hashlib.sha256`, their optional initial data parameter could
+ also be passed a keyword argument named ``data=`` or ``string=`` in
+ various :mod:`hashlib` implementations.
+
+ Support for the ``string`` keyword argument name is now deprecated and
+ is slated for removal in Python 3.19. Prefer passing the initial data as
+ a positional argument for maximum backwards compatibility.
+
+ (Contributed by Bénédikt Tran in :gh:`134978`.)
.. Add deprecations above alphabetically, not here at the end.
@@ -115,10 +210,70 @@ Deprecated
Removed
=======
-module_name
+ctypes
+------
+
+* Removed the undocumented function :func:`!ctypes.SetPointerType`,
+ which has been deprecated since Python 3.13.
+ (Contributed by Bénédikt Tran in :gh:`133866`.)
+
+
+http.server
-----------
-* TODO
+* Removed the :class:`!CGIHTTPRequestHandler` class
+ and the ``--cgi`` flag from the :program:`python -m http.server`
+ command-line interface. They were deprecated in Python 3.13.
+ (Contributed by Bénédikt Tran in :gh:`133810`.)
+
+
+platform
+--------
+
+* Removed the :func:`!platform.java_ver` function,
+ which was deprecated since Python 3.13.
+ (Contributed by Alexey Makridenko in :gh:`133604`.)
+
+
+sysconfig
+---------
+
+* Removed the *check_home* parameter of :func:`sysconfig.is_python_build`.
+ (Contributed by Filipe Laíns in :gh:`92897`.)
+
+
+threading
+---------
+
+* Remove support for arbitrary positional or keyword arguments in the C
+ implementation of :class:`~threading.RLock` objects. This was deprecated
+ in Python 3.14.
+ (Contributed by Bénédikt Tran in :gh:`134087`.)
+
+
+typing
+------
+
+* The undocumented keyword argument syntax for creating
+ :class:`~typing.NamedTuple` classes (for example,
+ ``Point = NamedTuple("Point", x=int, y=int)``) is no longer supported.
+ Use the class-based syntax or the functional syntax instead.
+ (Contributed by Bénédikt Tran in :gh:`133817`.)
+
+* Using ``TD = TypedDict("TD")`` or ``TD = TypedDict("TD", None)`` to
+ construct a :class:`~typing.TypedDict` type with zero field is no
+ longer supported. Use ``class TD(TypedDict): pass``
+ or ``TD = TypedDict("TD", {})`` instead.
+ (Contributed by Bénédikt Tran in :gh:`133823`.)
+
+
+wave
+----
+
+* Removed the ``getmark()``, ``setmark()`` and ``getmarkers()`` methods
+ of the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes,
+ which were deprecated since Python 3.13.
+ (Contributed by Bénédikt Tran in :gh:`133873`.)
Porting to Python 3.15
@@ -138,12 +293,31 @@ C API changes
New features
------------
-* TODO
+* Add :c:func:`PySys_GetAttr`, :c:func:`PySys_GetAttrString`,
+ :c:func:`PySys_GetOptionalAttr`, and :c:func:`PySys_GetOptionalAttrString`
+ functions as replacements for :c:func:`PySys_GetObject`.
+ (Contributed by Serhiy Storchaka in :gh:`108512`.)
+
+* Add :c:func:`PyUnicodeWriter_WriteASCII` function to write an ASCII string
+ into a :c:type:`PyUnicodeWriter`. The function is faster than
+ :c:func:`PyUnicodeWriter_WriteUTF8`, but has an undefined behavior if the
+ input string contains non-ASCII characters.
+ (Contributed by Victor Stinner in :gh:`133968`.)
+
Porting to Python 3.15
----------------------
-* TODO
+* :class:`sqlite3.Connection` APIs has been cleaned up.
+
+ * All parameters of :func:`sqlite3.connect` except *database* are now keyword-only.
+ * The first three parameters of methods :meth:`~sqlite3.Connection.create_function`
+ and :meth:`~sqlite3.Connection.create_aggregate` are now positional-only.
+ * The first parameter of methods :meth:`~sqlite3.Connection.set_authorizer`,
+ :meth:`~sqlite3.Connection.set_progress_handler` and
+ :meth:`~sqlite3.Connection.set_trace_callback` is now positional-only.
+
+ (Contributed by Serhiy Storchaka in :gh:`133595`.)
Deprecated C APIs
-----------------
@@ -155,3 +329,58 @@ Deprecated C APIs
Removed C APIs
--------------
+* Remove deprecated ``PyUnicode`` functions:
+
+ * :c:func:`!PyUnicode_AsDecodedObject`:
+ Use :c:func:`PyCodec_Decode` instead.
+ * :c:func:`!PyUnicode_AsDecodedUnicode`:
+ Use :c:func:`PyCodec_Decode` instead; Note that some codecs (for example, "base64")
+ may return a type other than :class:`str`, such as :class:`bytes`.
+ * :c:func:`!PyUnicode_AsEncodedObject`:
+ Use :c:func:`PyCodec_Encode` instead.
+ * :c:func:`!PyUnicode_AsEncodedUnicode`:
+ Use :c:func:`PyCodec_Encode` instead; Note that some codecs (for example, "base64")
+ may return a type other than :class:`bytes`, such as :class:`str`.
+
+ (Contributed by Stan Ulbrych in :gh:`133612`)
+
+* :c:func:`!PyImport_ImportModuleNoBlock`: deprecated alias
+ of :c:func:`PyImport_ImportModule`.
+ (Contributed by Bénédikt Tran in :gh:`133644`.)
+
+The following functions are removed in favor of :c:func:`PyConfig_Get`.
+The |pythoncapi_compat_project| can be used to get :c:func:`!PyConfig_Get`
+on Python 3.13 and older.
+
+* Python initialization functions:
+
+ * :c:func:`!Py_GetExecPrefix`:
+ use :c:func:`PyConfig_Get("base_exec_prefix") <PyConfig_Get>`
+ (:data:`sys.base_exec_prefix`) instead.
+ Use :c:func:`PyConfig_Get("exec_prefix") <PyConfig_Get>`
+ (:data:`sys.exec_prefix`) if :ref:`virtual environments <venv-def>`
+ need to be handled.
+ * :c:func:`!Py_GetPath`:
+ use :c:func:`PyConfig_Get("module_search_paths") <PyConfig_Get>`
+ (:data:`sys.path`) instead.
+ * :c:func:`!Py_GetPrefix`:
+ use :c:func:`PyConfig_Get("base_prefix") <PyConfig_Get>`
+ (:data:`sys.base_prefix`) instead.
+ Use :c:func:`PyConfig_Get("prefix") <PyConfig_Get>`
+ (:data:`sys.prefix`) if :ref:`virtual environments <venv-def>`
+ need to be handled.
+ * :c:func:`!Py_GetProgramFullPath`:
+ use :c:func:`PyConfig_Get("executable") <PyConfig_Get>`
+ (:data:`sys.executable`) instead.
+ * :c:func:`!Py_GetProgramName`:
+ use :c:func:`PyConfig_Get("executable") <PyConfig_Get>`
+ (:data:`sys.executable`) instead.
+ * :c:func:`!Py_GetPythonHome`:
+ use :c:func:`PyConfig_Get("home") <PyConfig_Get>` or the
+ :envvar:`PYTHONHOME` environment variable instead.
+
+ (Contributed by Bénédikt Tran in :gh:`133644`.)
+
+.. |pythoncapi_compat_project| replace:: |pythoncapi_compat_project_link|_
+.. |pythoncapi_compat_project_link| replace:: pythoncapi-compat project
+.. _pythoncapi_compat_project_link: https://github.com/python/pythoncapi-compat
diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst
index 7a8eb47cbdb..89fd6868645 100644
--- a/Doc/whatsnew/3.3.rst
+++ b/Doc/whatsnew/3.3.rst
@@ -829,7 +829,7 @@ Previous versions of CPython have always relied on a global import lock.
This led to unexpected annoyances, such as deadlocks when importing a module
would trigger code execution in a different thread as a side-effect.
Clumsy workarounds were sometimes employed, such as the
-:c:func:`PyImport_ImportModuleNoBlock` C API function.
+:c:func:`!PyImport_ImportModuleNoBlock` C API function.
In Python 3.3, importing a module takes a per-module lock. This correctly
serializes importation of a given module from multiple threads (preventing
diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst
index 7aca35b2959..bc2eb1d0e26 100644
--- a/Doc/whatsnew/3.8.rst
+++ b/Doc/whatsnew/3.8.rst
@@ -1629,8 +1629,8 @@ Build and C API Changes
(Contributed by Pablo Galindo in :issue:`37221`.)
* :c:func:`!Py_SetPath` now sets :data:`sys.executable` to the program full
- path (:c:func:`Py_GetProgramFullPath`) rather than to the program name
- (:c:func:`Py_GetProgramName`).
+ path (:c:func:`!Py_GetProgramFullPath`) rather than to the program name
+ (:c:func:`!Py_GetProgramName`).
(Contributed by Victor Stinner in :issue:`38234`.)