From 5ffebb4111ac4aaa2a9ba8c4b5c19b3e4424a315 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 26 Apr 2026 12:46:43 +0300 Subject: [PATCH 01/14] More colour in 3.15 --- Doc/whatsnew/3.15.rst | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index 3c2c7a7e399d09..0575a870bb68fe 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -540,10 +540,23 @@ Other language changes (Contributed by Adam Turner in :gh:`133711`; PEP 686 written by Inada Naoki.) + .. _whatsnew315-color-exceptions: + * Unraisable exceptions are now highlighted with color by default. This can be controlled by :ref:`environment variables `. (Contributed by Peter Bierma in :gh:`134170`.) +* More color in + :ref:`argparse `, + :ref:`ast `, + :ref:`difflib `, + :ref:`http.server `, + :ref:`PyREPL tab completion `, + :ref:`sqlite3 `, + :ref:`timeit `, + :ref:`tokenize ` and + :ref:`unraisable exceptions ` + * The :meth:`~object.__repr__` of :class:`ImportError` and :class:`ModuleNotFoundError` now shows "name" and "path" as ``name=`` and ``path=`` if they were given as keyword arguments at construction time. @@ -685,6 +698,19 @@ Other language changes (Contributed by Gregory P. Smith in :gh:`83065`.) +Default interactive shell +========================= + +.. _whatsnew315-pyrepl-completion: + +* Tab completions are now colored by object kind, based on + :pypi:`fancycompleter`. + Set :envvar:`PYTHON_BASIC_COMPLETER` to fall back to :mod:`rlcompleter`. + This can also be controlled by :ref:`environment variables + `. + (Contributed by Antonio Cuni and Pablo Galindo in :gh:`130472`.) + + New modules =========== @@ -710,6 +736,8 @@ argparse default to ``True``. This enables suggestions for mistyped arguments by default. (Contributed by Jakob Schluse in :gh:`140450`.) + .. _whatsnew315-color-argparse: + * Added backtick markup support in description and epilog text to highlight inline code when color output is enabled. (Contributed by Savannah Ostrowski in :gh:`142390`.) @@ -736,6 +764,8 @@ ast If ``False`` (the default), colored output is always disabled. (Contributed by Stan Ulbrych in :gh:`148981`.) + .. _whatsnew315-color-ast: + * The :ref:`command-line ` output is now syntax highlighted by default. This can be :ref:`controlled using environment variables `. (Contributed by Stan Ulbrych in :gh:`148981`.) @@ -948,6 +978,8 @@ http.cookies http.server ----------- + .. _whatsnew315-color-http.server: + * The logging of :mod:`~http.server.BaseHTTPRequestHandler`, as used by the :ref:`command-line interface `, is colored by default. @@ -1125,6 +1157,8 @@ sqlite3 * SQL keyword completion on . (Contributed by Long Tan in :gh:`133393`.) + .. _whatsnew315-color-sqlite3: + * Prompts, error messages, and help text are now colored. This is enabled by default, see :ref:`using-on-controlling-color` for details. @@ -1256,10 +1290,13 @@ tarfile timeit ------ + .. _whatsnew315-color-timeit: + * The output of the :mod:`timeit` command-line interface is colored by default. This can be controlled with :ref:`environment variables `. (Contributed by Hugo van Kemenade in :gh:`146609`.) + * The command-line interface now colorizes error tracebacks by default. This can be controlled with :ref:`environment variables `. @@ -1299,6 +1336,8 @@ tkinter tokenize -------- + .. _whatsnew315-color-tokenize: + * The output of the :mod:`tokenize` :ref:`command-line interface ` is colored by default. This can be controlled with :ref:`environment variables `. From a6aa50fe24b34165aa6efc41ee24367f23d3b3e9 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 26 Apr 2026 22:33:07 +0300 Subject: [PATCH 02/14] Document timeit CLI colour --- Doc/library/timeit.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Doc/library/timeit.rst b/Doc/library/timeit.rst index fd67c5c0a0f513..b16849067f8936 100644 --- a/Doc/library/timeit.rst +++ b/Doc/library/timeit.rst @@ -19,7 +19,7 @@ See also Tim Peters' introduction to the "Algorithms" chapter in the second edition of *Python Cookbook*, published by O'Reilly. -Basic Examples +Basic examples -------------- The following example shows how the :ref:`timeit-command-line-interface` @@ -56,7 +56,7 @@ repetitions only when the command-line interface is used. In the .. _python-interface: -Python Interface +Python interface ---------------- The module defines three convenience functions and a public class: @@ -206,7 +206,7 @@ The module defines three convenience functions and a public class: .. _timeit-command-line-interface: -Command-Line Interface +Command-line interface ---------------------- When called as a program from the command line, the following form is used:: @@ -279,6 +279,9 @@ most cases. You can use :func:`time.process_time` to measure CPU time. baseline overhead can be measured by invoking the program without arguments, and it might differ between Python versions. +.. versionadded:: next + Output is in color by default and can be + :ref:`controlled using environment variables `. .. _timeit-examples: From f6e91bed50a6be07b895d79ca074ad21b6c24a65 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 27 Apr 2026 19:46:54 +0300 Subject: [PATCH 03/14] Remove empty C API porting section --- Doc/whatsnew/3.15.rst | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index 0575a870bb68fe..afdd00e52e5ec3 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -2092,14 +2092,6 @@ Changed C APIs for ``NULL`` should be updated to call :c:macro:`PyDateTime_IMPORT` instead. (Contributed by Kumar Aditya in :gh:`141563`.) -Porting to Python 3.15 ----------------------- - -* Private functions promoted to public C APIs: - - The |pythoncapi_compat_project| can be used to get most of these new - functions on Python 3.14 and older. - Removed C APIs -------------- From 3ea85345c338d27cb446d04ef44bc95b653add8a Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 28 Apr 2026 11:52:52 +0300 Subject: [PATCH 04/14] Stub for PEP 793: PyModExport: A new entry point for C extension modules --- Doc/whatsnew/3.15.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index afdd00e52e5ec3..d7ec8226ed896a 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -86,6 +86,7 @@ Summary -- Release highlights * :pep:`782`: :ref:`A new PyBytesWriter C API to create a Python bytes object ` * :pep:`803`: :ref:`Stable ABI for Free-Threaded Builds ` +* :pep:`793`: PyModExport: A new entry point for C extension modules * :ref:`The JIT compiler has been significantly upgraded ` * :ref:`Improved error messages ` * :ref:`The official Windows 64-bit binaries now use the tail-calling interpreter From d8ed5fceb7292ecd9a73cbcfc8ab67d0f9810fce Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 28 Apr 2026 11:54:10 +0300 Subject: [PATCH 05/14] Sentence case --- Doc/whatsnew/3.15.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index d7ec8226ed896a..b956f09f30cbd9 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -85,7 +85,7 @@ Summary -- Release highlights * :pep:`800`: Disjoint bases in the type system * :pep:`782`: :ref:`A new PyBytesWriter C API to create a Python bytes object ` -* :pep:`803`: :ref:`Stable ABI for Free-Threaded Builds ` +* :pep:`803`: :ref:`Stable ABI for free-threaded builds ` * :pep:`793`: PyModExport: A new entry point for C extension modules * :ref:`The JIT compiler has been significantly upgraded ` * :ref:`Improved error messages ` @@ -414,7 +414,7 @@ agen() for x in a)``. .. _whatsnew315-abi3t: -:pep:`803`: ``abi3t`` -- Stable ABI for Free-Threaded Builds +:pep:`803`: ``abi3t`` -- Stable ABI for free-threaded builds ------------------------------------------------------------ C extensions that target the :ref:`Stable ABI ` can now be From 43b91fc459fbc20c5a90188a8377c9091767b432 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Wed, 29 Apr 2026 18:35:01 +0300 Subject: [PATCH 06/14] fixup! More colour in 3.15 --- Doc/whatsnew/3.15.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index b956f09f30cbd9..654821b70df3b6 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -552,6 +552,7 @@ Other language changes :ref:`ast `, :ref:`difflib `, :ref:`http.server `, + :ref:`pickletools `, :ref:`PyREPL tab completion `, :ref:`sqlite3 `, :ref:`timeit `, @@ -1089,6 +1090,8 @@ pickle pickletools ----------- + .. _whatsnew315-color-pickletools: + * The output of the :mod:`pickletools` command-line interface is colored by default. This can be controlled with :ref:`environment variables `. From 72efa35b022d402ec14004e21b75b4d805d09f96 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 5 May 2026 14:51:59 +0300 Subject: [PATCH 07/14] Words for refs not PEP numbers --- Doc/whatsnew/3.15.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index 5b5bd92d16589f..f41cb65d109cfc 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -76,7 +76,7 @@ Summary -- Release highlights * :pep:`799`: :ref:`Tachyon: High frequency statistical sampling profiler ` * :pep:`831`: :ref:`Frame pointers are enabled by default for improved - system-level observability ` + system-level observability ` * :pep:`798`: :ref:`Unpacking in comprehensions ` * :pep:`686`: :ref:`Python now uses UTF-8 as the default encoding @@ -379,7 +379,7 @@ available output formats, profiling modes, and configuration options. (Contributed by Pablo Galindo and László Kiss Kollár in :gh:`135953` and :gh:`138122`.) -.. _whatsnew315-pep831: +.. _whatsnew315-frame-pointers: :pep:`831`: Frame pointers enabled by default --------------------------------------------- From deb4cfa0565712ccfc2a698cb94c2369e505b2a5 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 5 May 2026 14:52:06 +0300 Subject: [PATCH 08/14] See also PEPs --- Doc/whatsnew/3.15.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index f41cb65d109cfc..59f30a14bd84a4 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -267,6 +267,8 @@ name. (PEP by Tal Einat; contributed by Jelle Zijlstra in :gh:`148829`.) +.. seealso:: :pep:`661` for further details. + .. _whatsnew315-profiling-package: @@ -405,12 +407,12 @@ embedding applications, and native libraries. single native component built without frame pointers can break stack unwinding for the whole Python process. -.. seealso:: :pep:`831` for further details. - (Contributed by Pablo Galindo Salgado and Savannah Ostrowski in :gh:`149201`; PEP 831 written by Pablo Galindo Salgado, Ken Jin, and Savannah Ostrowski.) +.. seealso:: :pep:`831` for further details. + .. _whatsnew315-unpacking-in-comprehensions: @@ -492,6 +494,8 @@ 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 in :ref:`abi3-compiling`. +.. seealso:: :pep:`803` for further details. + .. _whatsnew315-improved-error-messages: From 43853bfcd256f895303ae916830e6de1ed683f79 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 5 May 2026 14:54:21 +0300 Subject: [PATCH 09/14] Move PEP 829 up --- Doc/whatsnew/3.15.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index 59f30a14bd84a4..6c927dfa976d30 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -81,6 +81,7 @@ Summary -- Release highlights ` * :pep:`686`: :ref:`Python now uses UTF-8 as the default encoding ` +* :pep:`829`: Package startup configuration files * :pep:`728`: :ref:`TypedDict with typed extra items ` * :pep:`747`: :ref:`Annotating type forms with TypeForm ` @@ -94,7 +95,6 @@ Summary -- Release highlights * :ref:`Improved error messages ` * :ref:`The official Windows 64-bit binaries now use the tail-calling interpreter ` -* :pep:`829`: Package Startup Configuration Files New features ============ From a21ac378c4d8bab802cb1bee1ad9b5c4b0f1a36f Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 5 May 2026 15:26:51 +0300 Subject: [PATCH 10/14] Sentence case headers --- Doc/whatsnew/3.15.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index 6c927dfa976d30..e1b23d859c6110 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -89,7 +89,7 @@ Summary -- Release highlights * :pep:`782`: :ref:`A new PyBytesWriter C API to create a Python bytes object ` * :pep:`803`, :pep:`820 <820>`, :pep:`793 <793>`: - :ref:`Stable ABI for Free-Threaded Builds ` and + :ref:`Stable ABI for free-threaded builds ` and related C API * :ref:`The JIT compiler has been significantly upgraded ` * :ref:`Improved error messages ` From 4f3c19cd280da516c723ca7f3f6ae6e7950b7725 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 5 May 2026 15:31:36 +0300 Subject: [PATCH 11/14] More color --- Doc/whatsnew/3.15.rst | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index e1b23d859c6110..1b7df6f8ccdb7a 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -92,9 +92,11 @@ Summary -- Release highlights :ref:`Stable ABI for free-threaded builds ` and related C API * :ref:`The JIT compiler has been significantly upgraded ` -* :ref:`Improved error messages ` * :ref:`The official Windows 64-bit binaries now use the tail-calling interpreter ` +* :ref:`Improved error messages ` +* :ref:`More color ` + New features ============ @@ -637,17 +639,21 @@ Other language changes controlled by :ref:`environment variables `. (Contributed by Peter Bierma in :gh:`134170`.) + .. _whatsnew315-more-color: + * More color in :ref:`argparse `, :ref:`ast `, + :ref:`calendar `, :ref:`difflib `, :ref:`http.server `, :ref:`pickletools `, :ref:`PyREPL tab completion `, :ref:`sqlite3 `, :ref:`timeit `, - :ref:`tokenize ` and - :ref:`unraisable exceptions ` + :ref:`tokenize `, + :ref:`unraisable exceptions ` and + stdlib (ast, compileall, doctest, gzip, inspect, json.tool, pdb, profiling.sampling, random, regrtest, sqlite3, timeit, tokenize, trace, unittest, uuid, zipapp, zipfile) CLI help. * The :meth:`~object.__repr__` of :class:`ImportError` and :class:`ModuleNotFoundError` now shows "name" and "path" as ``name=`` and ``path=`` if they were given @@ -858,14 +864,14 @@ array ast --- + .. _whatsnew315-color-ast: + * Add *color* parameter to :func:`~ast.dump`. If ``True``, the returned string is syntax highlighted using ANSI escape sequences. If ``False`` (the default), colored output is always disabled. (Contributed by Stan Ulbrych in :gh:`148981`.) - .. _whatsnew315-color-ast: - * The :ref:`command-line ` output is now syntax highlighted by default. This can be :ref:`controlled using environment variables `. (Contributed by Stan Ulbrych in :gh:`148981`.) @@ -970,6 +976,11 @@ calendar dark mode and have been migrated to the HTML5 standard for improved accessibility. (Contributed by Jiahao Li and Hugo van Kemenade in :gh:`137634`.) + .. _whatsnew315-color-calendar: + +* Add more color to calendar CLI output: bold months and highlighted day names. + (Hugo van Kemenade in :gh:`148352`.) + collections ----------- From 1659803c7872327a80c380f5df853966ef97e20e Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Wed, 6 May 2026 14:23:35 +0300 Subject: [PATCH 12/14] Copyedit What's New in Python 3.15 --- Doc/whatsnew/3.15.rst | 54 +++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index 1b7df6f8ccdb7a..de168c1cd31f09 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -418,7 +418,7 @@ Savannah Ostrowski.) .. _whatsnew315-unpacking-in-comprehensions: -:pep:`798`: Unpacking in Comprehensions +:pep:`798`: Unpacking in comprehensions --------------------------------------- List, set, and dictionary comprehensions, as well as generator expressions, now @@ -653,7 +653,9 @@ Other language changes :ref:`timeit `, :ref:`tokenize `, :ref:`unraisable exceptions ` and - stdlib (ast, compileall, doctest, gzip, inspect, json.tool, pdb, profiling.sampling, random, regrtest, sqlite3, timeit, tokenize, trace, unittest, uuid, zipapp, zipfile) CLI help. + stdlib (ast, compileall, doctest, gzip, inspect, json.tool, pdb, + profiling.sampling, random, regrtest, sqlite3, timeit, tokenize, trace, + unittest, uuid, zipapp, zipfile) CLI help. * The :meth:`~object.__repr__` of :class:`ImportError` and :class:`ModuleNotFoundError` now shows "name" and "path" as ``name=`` and ``path=`` if they were given @@ -826,7 +828,7 @@ Improved modules argparse -------- -* The :class:`~argparse.BooleanOptionalAction` action supports now single-dash +* The :class:`~argparse.BooleanOptionalAction` action now supports single-dash long options and alternate prefix characters. (Contributed by Serhiy Storchaka in :gh:`138525`.) @@ -963,6 +965,8 @@ binascii calendar -------- + .. _whatsnew315-color-calendar: + * :mod:`calendar`'s :ref:`command-line ` text output has more color. This can be controlled with :ref:`environment variables `. @@ -976,11 +980,6 @@ calendar dark mode and have been migrated to the HTML5 standard for improved accessibility. (Contributed by Jiahao Li and Hugo van Kemenade in :gh:`137634`.) - .. _whatsnew315-color-calendar: - -* Add more color to calendar CLI output: bold months and highlighted day names. - (Hugo van Kemenade in :gh:`148352`.) - collections ----------- @@ -1031,7 +1030,7 @@ 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. + to recover unused free space previously occupied by deleted entries. (Contributed by Andrea Oliveri in :gh:`134004`.) @@ -1149,6 +1148,7 @@ inspect for :func:`~inspect.getdoc`. (Contributed by Serhiy Storchaka in :gh:`132686`.) + json ---- @@ -1445,7 +1445,7 @@ tarfile (Contributed by Matt Prodani and Petr Viktorin in :gh:`112887` and :cve:`2025-4435`.) * :func:`~tarfile.TarFile.extract` and :func:`~tarfile.TarFile.extractall` - now replace slashes by backslashes in symlink targets on Windows to prevent + now replace slashes with backslashes in symlink targets on Windows to prevent creation of corrupted links. (Contributed by Christoph Walcher in :gh:`57911`.) @@ -1611,7 +1611,7 @@ typing * Code like ``class B2(A[T2], Protocol[T1, T2]): ...`` now correctly handles type parameters order: it is ``(T1, T2)``, not ``(T2, T1)`` - as it was incorrectly inferred in runtime before. + as it was incorrectly inferred at runtime before. (Contributed by Nikita Sobolev in :gh:`137191`.) * :pep:`800`: Add :deco:`typing.disjoint_base`, a new decorator marking a class @@ -1674,8 +1674,8 @@ urllib.parse :func:`~urllib.parse.urlparse` and :func:`~urllib.parse.urldefrag` functions. Add the *keep_empty* parameter to :func:`~urllib.parse.urlunsplit` and :func:`~urllib.parse.urlunparse` functions. - This allows to distinguish between empty and not defined URI components - and preserve empty components. + This allows distinguishing between empty and undefined URI components + and preserving empty components. (Contributed by Serhiy Storchaka in :gh:`67041`.) @@ -1683,7 +1683,7 @@ venv ---- * On POSIX platforms, platlib directories will be created if needed when - creating virtual environments, instead of using ``lib64 -> lib`` symlink. + creating virtual environments, instead of using a ``lib64 -> lib`` symlink. This means purelib and platlib of virtual environments no longer share the same ``lib`` directory on platforms where :data:`sys.platlibdir` is not equal to ``lib``. @@ -1724,7 +1724,7 @@ wave xml --- -* Add the :func:`xml.is_valid_name` function, which allows to check +* Add the :func:`xml.is_valid_name` function to check whether a string can be used as an element or attribute name in XML. (Contributed by Serhiy Storchaka in :gh:`139489`.) @@ -1864,7 +1864,7 @@ reduces the cost of most operations in Python. Reiden Ong, Noam Cohen, Tomas Roun, PuQing, Cajetan Rodrigues, and Sacul in :gh:`134584`.) By tracking unique references to objects, the JIT optimizer can now eliminate -reference count updates and perform inplace operations on ints and floats. +reference count updates and perform in-place operations on ints and floats. (Contributed by Reiden Ong, and Pieter Eendebak in :gh:`143414` and :gh:`146306`.) The JIT optimizer now supports significantly more operations than in 3.14. @@ -2139,10 +2139,10 @@ New deprecations * :mod:`struct`: - * Calling the ``Struct.__new__()`` without required argument now is - deprecated and will be removed in Python 3.20. Calling - :meth:`~object.__init__` method on initialized :class:`~struct.Struct` - objects is deprecated and will be removed in Python 3.20. + * Calling ``Struct.__new__()`` without a required argument is now + deprecated and will be removed in Python 3.20. Calling the + :meth:`~object.__init__` method on an initialized :class:`~struct.Struct` + object is deprecated and will be removed in Python 3.20. (Contributed by Sergey B Kirpichev and Serhiy Storchaka in :gh:`143715`.) @@ -2245,8 +2245,8 @@ New features (Contributed by Petr Viktorin in :gh:`131510`.) * Add API for checking an extension module's ABI compatibility: - :c:data:`Py_mod_abi`, :c:func:`PyABIInfo_Check`, :c:macro:`PyABIInfo_VAR` - and :c:data:`Py_mod_abi`. + :c:data:`Py_mod_abi`, :c:func:`PyABIInfo_Check`, + and :c:macro:`PyABIInfo_VAR`. (Contributed by Petr Viktorin in :gh:`137210`.) .. _whatsnew315-pybyteswriter: @@ -2309,14 +2309,14 @@ New features * The :c:type:`PySlot` struct; * the :c:func:`PyType_FromSlots` function; * new slot IDs: :c:macro:`Py_slot_end`, :c:macro:`Py_slot_invalid`; - :c:macro:`Py_slot_subslots`, :c:macro:`Py_tp_slots` + :c:macro:`Py_slot_subslots`, :c:macro:`Py_tp_slots`, :c:macro:`Py_mod_slots`; :c:macro:`Py_tp_name`, :c:macro:`Py_tp_basicsize`, :c:macro:`Py_tp_extra_basicsize`, :c:macro:`Py_tp_itemsize`, :c:macro:`Py_tp_flags`, :c:macro:`Py_tp_metaclass`, - :c:macro:`Py_tp_module`, :c:macro:`Py_tp_flags`; + :c:macro:`Py_tp_module`; * convenience macros: :c:macro:`PySlot_DATA`, :c:macro:`PySlot_FUNC`, - :c:macro:`PySlot_SIZE` :c:macro:`PySlot_INT64`, :c:macro:`PySlot_UINT64`, + :c:macro:`PySlot_SIZE`, :c:macro:`PySlot_INT64`, :c:macro:`PySlot_UINT64`, :c:macro:`PySlot_STATIC_DATA`, :c:macro:`PySlot_END`, :c:macro:`PySlot_PTR`, :c:macro:`PySlot_PTR_STATIC`. @@ -2369,12 +2369,12 @@ Removed C APIs * :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") + 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") + 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`.) From e9cace586451a153befeab8279d17105511350f0 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Wed, 6 May 2026 19:10:23 +0300 Subject: [PATCH 13/14] Updates + review updates --- Doc/whatsnew/3.15.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index a72ec6bc484f02..3e66a940801675 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -658,6 +658,8 @@ Other language changes (Contributed by Adam Turner in :gh:`133711`; PEP 686 written by Inada Naoki.) + .. _whatsnew315-color-interpreter-help: + * The interpreter help (such as ``python --help``) is now in color. This can be controlled by :ref:`environment variables `. @@ -679,11 +681,12 @@ Other language changes :ref:`http.server `, :ref:`pickletools `, :ref:`PyREPL tab completion `, + :ref:`python --help `, :ref:`sqlite3 `, :ref:`timeit `, :ref:`tokenize `, :ref:`unraisable exceptions ` and - stdlib (ast, compileall, doctest, gzip, inspect, json.tool, pdb, + :term:`stdlib` (ast, compileall, doctest, gzip, inspect, json.tool, pdb, profiling.sampling, random, regrtest, sqlite3, timeit, tokenize, trace, unittest, uuid, zipapp, zipfile) CLI help. @@ -836,7 +839,7 @@ Default interactive shell * Tab completions are now colored by object kind, based on :pypi:`fancycompleter`. Set :envvar:`PYTHON_BASIC_COMPLETER` to fall back to :mod:`rlcompleter`. - This can also be controlled by :ref:`environment variables + Color can also be controlled by :ref:`environment variables `. (Contributed by Antonio Cuni and Pablo Galindo in :gh:`130472`.) From bcae970a77ff63c70a57a262f3660fadc8b56baa Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Wed, 6 May 2026 20:16:04 +0300 Subject: [PATCH 14/14] Delete duplicate ref --- Doc/whatsnew/3.15.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index cac837de5f3644..9ac231224b7b1d 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -2604,8 +2604,6 @@ Build changes and :option:`-X dev <-X>` is passed to the Python or Python is built in :ref:`debug mode `. (Contributed by Donghee Na in :gh:`141770`.) -.. _whatsnew315-frame-pointers: - * CPython is now built with frame pointers enabled by default (:pep:`831`). Pass :option:`--without-frame-pointers` to opt out.