Skip to content

Commit a646c99

Browse files
authored
gh-133879: Copyedit "What's New in Python 3.15" (#154978)
1 parent 2ac8900 commit a646c99

2 files changed

Lines changed: 57 additions & 31 deletions

File tree

Doc/deprecations/pending-removal-in-3.17.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ Pending removal in Python 3.17
3737
is deprecated and scheduled for removal in Python 3.17.
3838
(Contributed by Stan Ulbrych in :gh:`136702`.)
3939

40+
* :mod:`profile`:
41+
42+
- The :mod:`!profile` module is deprecated and will be removed in
43+
Python 3.17. Use :mod:`profiling.tracing` instead, which provides a
44+
compatible API. See :pep:`799` for details.
45+
(Contributed by Pablo Galindo and László Kiss Kollár in :gh:`138122`.)
46+
4047
* :mod:`webbrowser`:
4148

4249
- :class:`!webbrowser.MacOSXOSAScript` is deprecated in favour of

Doc/whatsnew/3.15.rst

Lines changed: 50 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Summary -- Release highlights
8585
* :pep:`728`: :ref:`TypedDict with typed extra items <whatsnew315-typeddict>`
8686
* :pep:`747`: :ref:`Annotating type forms with TypeForm
8787
<whatsnew315-typeform>`
88-
* :pep:`800`: Disjoint bases in the type system
88+
* :pep:`800`: :ref:`Disjoint bases in the type system <whatsnew315-disjoint-base>`
8989
* :pep:`782`: :ref:`A new PyBytesWriter C API to create a Python bytes object
9090
<whatsnew315-pybyteswriter>`
9191
* :pep:`803`, :pep:`820 <820>`, :pep:`793 <793>`:
@@ -494,8 +494,8 @@ drive it with :meth:`~site.StartupState.addsitedir`,
494494

495495
.. _whatsnew315-abi3t:
496496

497-
:pep:`803` -- Stable ABI for free-threaded builds
498-
-------------------------------------------------
497+
:pep:`803`: Stable ABI for free-threaded builds
498+
-----------------------------------------------
499499

500500
C extensions that target the :ref:`Stable ABI <stable-abi>` can now be
501501
compiled for the new *Stable ABI for Free-Threaded Builds* (also known
@@ -522,7 +522,7 @@ free-threading (``cp315t``) separately.
522522
Stable ABI for Free-Threaded Builds should typically
523523
be selected in a build tool (such as, for example, Setuptools, meson-python,
524524
scikit-build-core, or Maturin).
525-
At the time of writing, these tools did **not** support ``abi3t``.
525+
At the time of writing, these tools do **not** support ``abi3t``.
526526
If this is the case for your tool, compile for ``cp315t`` separately.
527527
If not using a build tool -- or when writing such a tool -- you can select
528528
``abi3t`` by setting the macro :c:macro:`!Py_TARGET_ABI3T` as discussed
@@ -1103,6 +1103,16 @@ contextlib
11031103
(Contributed by Alex Grönholm & Gregory P. Smith in :gh:`125862`.)
11041104

11051105

1106+
ctypes
1107+
------
1108+
1109+
* Change the :py:attr:`~ctypes._SimpleCData._type_` of
1110+
:class:`~ctypes.c_float_complex`, :class:`~ctypes.c_double_complex` and
1111+
:class:`~ctypes.c_longdouble_complex` from ``F``, ``D`` and ``G`` to ``Zf``,
1112+
``Zd`` and ``Zg`` for compatibility with NumPy.
1113+
(Contributed by Victor Stinner in :gh:`148675`.)
1114+
1115+
11061116
dataclasses
11071117
-----------
11081118

@@ -1229,7 +1239,7 @@ importlib.metadata
12291239
------------------
12301240

12311241
* Previously, when accessing a distribution metadata directory not
1232-
containing a metadata file, ``metadata()`` and ``Distribution.metadata()``
1242+
containing a metadata file, ``metadata()`` and ``Distribution.metadata``
12331243
would return an empty ``PackageMetadata`` object as if the file
12341244
was present but empty. Now, a ``MetadataNotFound`` exception is raised.
12351245
See `importlib_metadata#493 <https://github.com/python/importlib_metadata/issues/493>`_
@@ -1333,6 +1343,14 @@ os.path
13331343
(Contributed by Petr Viktorin for :cve:`2025-4517`.)
13341344

13351345

1346+
pathlib
1347+
-------
1348+
1349+
* :meth:`pathlib.Path.mkdir` now has a *parent_mode* parameter that allows
1350+
specifying the mode for intermediate directories when ``parents=True``.
1351+
(Contributed by Gregory P. Smith in :gh:`86533`.)
1352+
1353+
13361354
pdb
13371355
---
13381356

@@ -1447,7 +1465,7 @@ ssl
14471465
supports "External PSKs" in TLSv1.3, as described in :rfc:`9258`.
14481466
(Contributed by Will Childs-Klein in :gh:`133624`.)
14491467

1450-
* Added new methods for managing groups used for SSL key agreement
1468+
* Added new methods for managing groups used for SSL key agreement:
14511469

14521470
* :meth:`ssl.SSLContext.set_groups` sets the groups allowed for doing
14531471
key agreement, extending the previous
@@ -1726,6 +1744,8 @@ typing
17261744
as it was incorrectly inferred at runtime before.
17271745
(Contributed by Nikita Sobolev in :gh:`137191`.)
17281746

1747+
.. _whatsnew315-disjoint-base:
1748+
17291749
* :pep:`800`: Add :deco:`typing.disjoint_base`, a new decorator marking a class
17301750
as a disjoint base. This is an advanced feature primarily intended to allow
17311751
type checkers to faithfully reflect the runtime semantics of types defined
@@ -1854,8 +1874,8 @@ xml
18541874
whether a string can be used as an element or attribute name in XML.
18551875
(Contributed by Serhiy Storchaka in :gh:`139489`.)
18561876

1857-
* Add the :func:`xml.is_valid_text` function, which allows to check
1858-
whether a string can be used in the XML document.
1877+
* Add the :func:`xml.is_valid_text` function to check
1878+
whether a string can be used in an XML document.
18591879
(Contributed by Serhiy Storchaka in :gh:`139489`.)
18601880

18611881

@@ -1989,8 +2009,8 @@ is now performed. This means when the JIT compiler detects that certain user
19892009
code results in constants, the code can be simplified by the JIT.
19902010
(Contributed by Ken Jin and Savannah Ostrowski in :gh:`132732`.)
19912011

1992-
:term:`Reference count`\ s are avoided whenever it is safe to do so. This generally
1993-
reduces the cost of most operations in Python.
2012+
:term:`Reference counts <reference count>` are avoided whenever it is safe to
2013+
do so. This generally reduces the cost of most operations in Python.
19942014
(Contributed by Ken Jin, Donghee Na, Zheao Li, Hai Zhu, Savannah Ostrowski,
19952015
Reiden Ong, Noam Cohen, Tomas Roun, PuQing, Cajetan Rodrigues, and Sacul in :gh:`134584`.)
19962016

@@ -2058,12 +2078,6 @@ ctypes
20582078
which has been deprecated since Python 3.13.
20592079
(Contributed by Bénédikt Tran in :gh:`133866`.)
20602080

2061-
* Change the :py:attr:`~ctypes._SimpleCData._type_` of
2062-
:class:`~ctypes.c_float_complex`, :class:`~ctypes.c_double_complex` and
2063-
:class:`~ctypes.c_longdouble_complex` from ``F``, ``D`` and ``G`` to ``Zf``,
2064-
``Zd`` and ``Zg`` for compatibility with numpy.
2065-
(Contributed by Victor Stinner in :gh:`148675`.)
2066-
20672081

20682082
datetime
20692083
--------
@@ -2103,10 +2117,6 @@ importlib.resources
21032117
pathlib
21042118
-------
21052119

2106-
* :meth:`pathlib.Path.mkdir` now has a *parent_mode* parameter that allows
2107-
specifying the mode for intermediate directories when ``parents=True``.
2108-
(Contributed by Gregory P. Smith in :gh:`86533`.)
2109-
21102120
* Removed deprecated :meth:`!pathlib.PurePath.is_reserved`.
21112121
Use :func:`os.path.isreserved` to detect reserved paths on Windows.
21122122
(Contributed by Nikita Sobolev in :gh:`133875`.)
@@ -2146,8 +2156,8 @@ threading
21462156
types
21472157
-----
21482158

2149-
* Removed deprecated in :pep:`626` since Python 3.12
2150-
:attr:`!codeobject.co_lnotab` from :class:`types.CodeType`.
2159+
* Removed :attr:`!codeobject.co_lnotab` from :class:`types.CodeType`,
2160+
deprecated since Python 3.12 by :pep:`626`.
21512161
(Contributed by Nikita Sobolev in :gh:`134690`.)
21522162

21532163

@@ -2270,6 +2280,14 @@ New deprecations
22702280
and changing its value does *not* explicitly close the current file.
22712281

22722282

2283+
* :mod:`profile`:
2284+
2285+
* The :mod:`!profile` module is deprecated and will be removed in
2286+
Python 3.17. Use :mod:`profiling.tracing` instead, which provides a
2287+
compatible API. See :pep:`799` for details.
2288+
(Contributed by Pablo Galindo and László Kiss Kollár in :gh:`138122`.)
2289+
2290+
22732291
* :mod:`re`:
22742292

22752293
* :func:`re.match` and :meth:`re.Pattern.match` are now
@@ -2299,8 +2317,8 @@ New deprecations
22992317

23002318
(Contributed by Sergey B Kirpichev and Serhiy Storchaka in :gh:`143715`.)
23012319

2302-
* Using ``'F'`` and ``'D'`` type codes now are :term:`soft deprecated`
2303-
in favor of two-letter forms ``'Zf'`` and ``'Zd'``.
2320+
* The ``'F'`` and ``'D'`` type codes are now :term:`soft deprecated`
2321+
in favor of the two-letter forms ``'Zf'`` and ``'Zd'``.
23042322
(Contributed by Sergey B Kirpichev in :gh:`121249`.)
23052323

23062324

@@ -2413,7 +2431,7 @@ New features
24132431
functions as replacements for :c:func:`PySys_GetObject`.
24142432
(Contributed by Serhiy Storchaka in :gh:`108512`.)
24152433

2416-
* Add :c:type:`PyUnstable_Unicode_GET_CACHED_HASH` to get the cached hash of
2434+
* Add :c:func:`PyUnstable_Unicode_GET_CACHED_HASH` to get the cached hash of
24172435
a string. See the documentation for caveats.
24182436
(Contributed by Petr Viktorin in :gh:`131510`.)
24192437

@@ -2429,14 +2447,14 @@ New features
24292447

24302448
* :c:func:`PyBytesWriter_Create`
24312449
* :c:func:`PyBytesWriter_Discard`
2450+
* :c:func:`PyBytesWriter_Finish`
24322451
* :c:func:`PyBytesWriter_FinishWithPointer`
24332452
* :c:func:`PyBytesWriter_FinishWithSize`
2434-
* :c:func:`PyBytesWriter_Finish`
24352453
* :c:func:`PyBytesWriter_Format`
24362454
* :c:func:`PyBytesWriter_GetData`
24372455
* :c:func:`PyBytesWriter_GetSize`
2438-
* :c:func:`PyBytesWriter_GrowAndUpdatePointer`
24392456
* :c:func:`PyBytesWriter_Grow`
2457+
* :c:func:`PyBytesWriter_GrowAndUpdatePointer`
24402458
* :c:func:`PyBytesWriter_Resize`
24412459
* :c:func:`PyBytesWriter_WriteBytes`
24422460

@@ -2447,7 +2465,7 @@ New features
24472465

24482466
(Contributed in :gh:`149227`.)
24492467

2450-
* Add a new :c:func:`PyImport_CreateModuleFromInitfunc` C-API for creating
2468+
* Add a new :c:func:`PyImport_CreateModuleFromInitfunc` C API for creating
24512469
a module from a *spec* and *initfunc*.
24522470
(Contributed by Itamar Oren in :gh:`116146`.)
24532471

@@ -2521,7 +2539,7 @@ New features
25212539
thread state.
25222540
(Contributed by Victor Stinner in :gh:`139653`.)
25232541

2524-
* Add :c:func:`PyUnstable_SetImmortal` C-API function to mark objects as :term:`immortal`.
2542+
* Add :c:func:`PyUnstable_SetImmortal` C API function to mark objects as :term:`immortal`.
25252543
(Contributed by Kumar Aditya in :gh:`143300`.)
25262544

25272545
* Restore private provisional ``_Py_InitializeMain()`` function removed in
@@ -2714,10 +2732,11 @@ Build changes
27142732
At runtime, huge pages must be explicitly enabled by setting the
27152733
:envvar:`PYTHON_PYMALLOC_HUGEPAGES` environment variable to ``1``.
27162734

2717-
* Annotating anonymous mmap usage is now supported if Linux kernel supports
2735+
* Annotating anonymous mmap usage is now supported if the Linux kernel supports
27182736
:manpage:`PR_SET_VMA_ANON_NAME <PR_SET_VMA(2const)>` (Linux 5.17 or newer).
27192737
Annotations are visible in ``/proc/<pid>/maps`` if the kernel supports the feature
2720-
and :option:`-X dev <-X>` is passed to the Python or Python is built in :ref:`debug mode <debug-build>`.
2738+
and :option:`-X dev <-X>` is passed to Python,
2739+
or Python is built in :ref:`debug mode <debug-build>`.
27212740
(Contributed by Donghee Na in :gh:`141770`.)
27222741

27232742
* CPython is now built with frame pointers enabled by default

0 commit comments

Comments
 (0)