From a646c99ee12fbf421394a74955d42fd3fe850b7e Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Fri, 31 Jul 2026 19:18:49 +0300 Subject: [PATCH] gh-133879: Copyedit "What's New in Python 3.15" (#154978) --- Doc/deprecations/pending-removal-in-3.17.rst | 7 ++ Doc/whatsnew/3.15.rst | 81 ++++++++++++-------- 2 files changed, 57 insertions(+), 31 deletions(-) diff --git a/Doc/deprecations/pending-removal-in-3.17.rst b/Doc/deprecations/pending-removal-in-3.17.rst index d6e4e81afbbd..5ed674951d90 100644 --- a/Doc/deprecations/pending-removal-in-3.17.rst +++ b/Doc/deprecations/pending-removal-in-3.17.rst @@ -37,6 +37,13 @@ Pending removal in Python 3.17 is deprecated and scheduled for removal in Python 3.17. (Contributed by Stan Ulbrych in :gh:`136702`.) +* :mod:`profile`: + + - The :mod:`!profile` module is deprecated and will be removed in + Python 3.17. Use :mod:`profiling.tracing` instead, which provides a + compatible API. See :pep:`799` for details. + (Contributed by Pablo Galindo and László Kiss Kollár in :gh:`138122`.) + * :mod:`webbrowser`: - :class:`!webbrowser.MacOSXOSAScript` is deprecated in favour of diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index daac31fd7f4b..5a8ab88a30fc 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -85,7 +85,7 @@ Summary -- Release highlights * :pep:`728`: :ref:`TypedDict with typed extra items ` * :pep:`747`: :ref:`Annotating type forms with TypeForm ` -* :pep:`800`: Disjoint bases in the type system +* :pep:`800`: :ref:`Disjoint bases in the type system ` * :pep:`782`: :ref:`A new PyBytesWriter C API to create a Python bytes object ` * :pep:`803`, :pep:`820 <820>`, :pep:`793 <793>`: @@ -494,8 +494,8 @@ drive it with :meth:`~site.StartupState.addsitedir`, .. _whatsnew315-abi3t: -:pep:`803` -- Stable ABI for free-threaded builds -------------------------------------------------- +:pep:`803`: Stable ABI for free-threaded builds +----------------------------------------------- C extensions that target the :ref:`Stable ABI ` can now be compiled for the new *Stable ABI for Free-Threaded Builds* (also known @@ -522,7 +522,7 @@ free-threading (``cp315t``) separately. Stable ABI for Free-Threaded Builds should typically be selected in a build tool (such as, for example, Setuptools, meson-python, scikit-build-core, or Maturin). -At the time of writing, these tools did **not** support ``abi3t``. +At the time of writing, these tools do **not** support ``abi3t``. If this is the case for your tool, compile for ``cp315t`` separately. If not using a build tool -- or when writing such a tool -- you can select ``abi3t`` by setting the macro :c:macro:`!Py_TARGET_ABI3T` as discussed @@ -1103,6 +1103,16 @@ contextlib (Contributed by Alex Grönholm & Gregory P. Smith in :gh:`125862`.) +ctypes +------ + +* Change the :py:attr:`~ctypes._SimpleCData._type_` of + :class:`~ctypes.c_float_complex`, :class:`~ctypes.c_double_complex` and + :class:`~ctypes.c_longdouble_complex` from ``F``, ``D`` and ``G`` to ``Zf``, + ``Zd`` and ``Zg`` for compatibility with NumPy. + (Contributed by Victor Stinner in :gh:`148675`.) + + dataclasses ----------- @@ -1229,7 +1239,7 @@ importlib.metadata ------------------ * Previously, when accessing a distribution metadata directory not - containing a metadata file, ``metadata()`` and ``Distribution.metadata()`` + containing a metadata file, ``metadata()`` and ``Distribution.metadata`` would return an empty ``PackageMetadata`` object as if the file was present but empty. Now, a ``MetadataNotFound`` exception is raised. See `importlib_metadata#493 `_ @@ -1333,6 +1343,14 @@ os.path (Contributed by Petr Viktorin for :cve:`2025-4517`.) +pathlib +------- + +* :meth:`pathlib.Path.mkdir` now has a *parent_mode* parameter that allows + specifying the mode for intermediate directories when ``parents=True``. + (Contributed by Gregory P. Smith in :gh:`86533`.) + + pdb --- @@ -1447,7 +1465,7 @@ ssl supports "External PSKs" in TLSv1.3, as described in :rfc:`9258`. (Contributed by Will Childs-Klein in :gh:`133624`.) -* Added new methods for managing groups used for SSL key agreement +* Added new methods for managing groups used for SSL key agreement: * :meth:`ssl.SSLContext.set_groups` sets the groups allowed for doing key agreement, extending the previous @@ -1726,6 +1744,8 @@ typing as it was incorrectly inferred at runtime before. (Contributed by Nikita Sobolev in :gh:`137191`.) + .. _whatsnew315-disjoint-base: + * :pep:`800`: Add :deco:`typing.disjoint_base`, a new decorator marking a class as a disjoint base. This is an advanced feature primarily intended to allow type checkers to faithfully reflect the runtime semantics of types defined @@ -1854,8 +1874,8 @@ xml whether a string can be used as an element or attribute name in XML. (Contributed by Serhiy Storchaka in :gh:`139489`.) -* Add the :func:`xml.is_valid_text` function, which allows to check - whether a string can be used in the XML document. +* Add the :func:`xml.is_valid_text` function to check + whether a string can be used in an XML document. (Contributed by Serhiy Storchaka in :gh:`139489`.) @@ -1989,8 +2009,8 @@ is now performed. This means when the JIT compiler detects that certain user code results in constants, the code can be simplified by the JIT. (Contributed by Ken Jin and Savannah Ostrowski in :gh:`132732`.) -:term:`Reference count`\ s are avoided whenever it is safe to do so. This generally -reduces the cost of most operations in Python. +:term:`Reference counts ` are avoided whenever it is safe to +do so. This generally reduces the cost of most operations in Python. (Contributed by Ken Jin, Donghee Na, Zheao Li, Hai Zhu, Savannah Ostrowski, Reiden Ong, Noam Cohen, Tomas Roun, PuQing, Cajetan Rodrigues, and Sacul in :gh:`134584`.) @@ -2058,12 +2078,6 @@ ctypes which has been deprecated since Python 3.13. (Contributed by Bénédikt Tran in :gh:`133866`.) -* Change the :py:attr:`~ctypes._SimpleCData._type_` of - :class:`~ctypes.c_float_complex`, :class:`~ctypes.c_double_complex` and - :class:`~ctypes.c_longdouble_complex` from ``F``, ``D`` and ``G`` to ``Zf``, - ``Zd`` and ``Zg`` for compatibility with numpy. - (Contributed by Victor Stinner in :gh:`148675`.) - datetime -------- @@ -2103,10 +2117,6 @@ importlib.resources pathlib ------- -* :meth:`pathlib.Path.mkdir` now has a *parent_mode* parameter that allows - specifying the mode for intermediate directories when ``parents=True``. - (Contributed by Gregory P. Smith in :gh:`86533`.) - * Removed deprecated :meth:`!pathlib.PurePath.is_reserved`. Use :func:`os.path.isreserved` to detect reserved paths on Windows. (Contributed by Nikita Sobolev in :gh:`133875`.) @@ -2146,8 +2156,8 @@ threading types ----- -* Removed deprecated in :pep:`626` since Python 3.12 - :attr:`!codeobject.co_lnotab` from :class:`types.CodeType`. +* Removed :attr:`!codeobject.co_lnotab` from :class:`types.CodeType`, + deprecated since Python 3.12 by :pep:`626`. (Contributed by Nikita Sobolev in :gh:`134690`.) @@ -2270,6 +2280,14 @@ New deprecations and changing its value does *not* explicitly close the current file. +* :mod:`profile`: + + * The :mod:`!profile` module is deprecated and will be removed in + Python 3.17. Use :mod:`profiling.tracing` instead, which provides a + compatible API. See :pep:`799` for details. + (Contributed by Pablo Galindo and László Kiss Kollár in :gh:`138122`.) + + * :mod:`re`: * :func:`re.match` and :meth:`re.Pattern.match` are now @@ -2299,8 +2317,8 @@ New deprecations (Contributed by Sergey B Kirpichev and Serhiy Storchaka in :gh:`143715`.) - * Using ``'F'`` and ``'D'`` type codes now are :term:`soft deprecated` - in favor of two-letter forms ``'Zf'`` and ``'Zd'``. + * The ``'F'`` and ``'D'`` type codes are now :term:`soft deprecated` + in favor of the two-letter forms ``'Zf'`` and ``'Zd'``. (Contributed by Sergey B Kirpichev in :gh:`121249`.) @@ -2413,7 +2431,7 @@ New features functions as replacements for :c:func:`PySys_GetObject`. (Contributed by Serhiy Storchaka in :gh:`108512`.) -* Add :c:type:`PyUnstable_Unicode_GET_CACHED_HASH` to get the cached hash of +* Add :c:func:`PyUnstable_Unicode_GET_CACHED_HASH` to get the cached hash of a string. See the documentation for caveats. (Contributed by Petr Viktorin in :gh:`131510`.) @@ -2429,14 +2447,14 @@ New features * :c:func:`PyBytesWriter_Create` * :c:func:`PyBytesWriter_Discard` + * :c:func:`PyBytesWriter_Finish` * :c:func:`PyBytesWriter_FinishWithPointer` * :c:func:`PyBytesWriter_FinishWithSize` - * :c:func:`PyBytesWriter_Finish` * :c:func:`PyBytesWriter_Format` * :c:func:`PyBytesWriter_GetData` * :c:func:`PyBytesWriter_GetSize` - * :c:func:`PyBytesWriter_GrowAndUpdatePointer` * :c:func:`PyBytesWriter_Grow` + * :c:func:`PyBytesWriter_GrowAndUpdatePointer` * :c:func:`PyBytesWriter_Resize` * :c:func:`PyBytesWriter_WriteBytes` @@ -2447,7 +2465,7 @@ New features (Contributed in :gh:`149227`.) -* Add a new :c:func:`PyImport_CreateModuleFromInitfunc` C-API for creating +* Add a new :c:func:`PyImport_CreateModuleFromInitfunc` C API for creating a module from a *spec* and *initfunc*. (Contributed by Itamar Oren in :gh:`116146`.) @@ -2521,7 +2539,7 @@ New features thread state. (Contributed by Victor Stinner in :gh:`139653`.) -* Add :c:func:`PyUnstable_SetImmortal` C-API function to mark objects as :term:`immortal`. +* Add :c:func:`PyUnstable_SetImmortal` C API function to mark objects as :term:`immortal`. (Contributed by Kumar Aditya in :gh:`143300`.) * Restore private provisional ``_Py_InitializeMain()`` function removed in @@ -2714,10 +2732,11 @@ Build changes At runtime, huge pages must be explicitly enabled by setting the :envvar:`PYTHON_PYMALLOC_HUGEPAGES` environment variable to ``1``. -* Annotating anonymous mmap usage is now supported if Linux kernel supports +* Annotating anonymous mmap usage is now supported if the Linux kernel supports :manpage:`PR_SET_VMA_ANON_NAME ` (Linux 5.17 or newer). Annotations are visible in ``/proc//maps`` if the kernel supports the feature - and :option:`-X dev <-X>` is passed to the Python or Python is built in :ref:`debug mode `. + and :option:`-X dev <-X>` is passed to Python, + or Python is built in :ref:`debug mode `. (Contributed by Donghee Na in :gh:`141770`.) * CPython is now built with frame pointers enabled by default -- 2.47.3