gh-133879: Copyedit "What's new in Python 3.15" (#145737)

This commit is contained in:
Hugo van Kemenade 2026-03-10 13:11:43 +02:00 committed by GitHub
parent 478a315b7a
commit 55b36fdb3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -66,19 +66,22 @@ Summary -- Release highlights
.. PEP-sized items next.
* :pep:`810`: :ref:`Explicit lazy imports for faster startup times
<whatsnew315-pep810>`
<whatsnew315-lazy-imports>`
* :pep:`814`: :ref:`Add frozendict built-in type
<whatsnew315-frozendict>`
* :pep:`799`: :ref:`A dedicated profiling package for organizing Python
profiling tools <whatsnew315-profiling-package>`
* :pep:`799`: :ref:`Tachyon: High frequency statistical sampling profiler
<whatsnew315-sampling-profiler>`
* :pep:`798`: :ref:`Unpacking in Comprehensions
* :pep:`798`: :ref:`Unpacking in comprehensions
<whatsnew315-unpacking-in-comprehensions>`
* :pep:`686`: :ref:`Python now uses UTF-8 as the default encoding
<whatsnew315-utf8-default>`
* :pep:`728`: ``TypedDict`` with typed extra items
* :pep:`747`: :ref:`Annotating type forms with TypeForm
<whatsnew315-typeform>`
* :pep:`782`: :ref:`A new PyBytesWriter C API to create a Python bytes object
<whatsnew315-pep782>`
<whatsnew315-pybyteswriter>`
* :ref:`The JIT compiler has been significantly upgraded <whatsnew315-jit>`
* :ref:`Improved error messages <whatsnew315-improved-error-messages>`
@ -86,7 +89,7 @@ Summary -- Release highlights
New features
============
.. _whatsnew315-pep810:
.. _whatsnew315-lazy-imports:
:pep:`810`: Explicit lazy imports
---------------------------------
@ -120,12 +123,12 @@ name:
.. code-block:: python
lazy import json
lazy from datetime import datetime
lazy from pathlib import Path
print("Starting up...") # json and datetime not loaded yet
print("Starting up...") # json and pathlib not loaded yet
data = json.loads('{"key": "value"}') # json gets loads here
now = datetime() # datetime loads here
data = json.loads('{"key": "value"}') # json loads here
p = Path(".") # pathlib loads here
This mechanism is particularly useful for applications that import many
modules at the top level but may only use a subset of them in any given run.
@ -189,9 +192,9 @@ raise :exc:`SyntaxError`).
----------------------------------------
A new :term:`immutable` type, :class:`frozendict`, is added to the :mod:`builtins` module.
It does not allow modification after creation. A ``frozendict`` is not a subclass of ``dict``;
it inherits directly from ``object``. A ``frozendict`` is :term:`hashable`
as long as all of its keys and values are hashable. A ``frozendict`` preserves
It does not allow modification after creation. A :class:`!frozendict` is not a subclass of ``dict``;
it inherits directly from ``object``. A :class:`!frozendict` is :term:`hashable`
as long as all of its keys and values are hashable. A :class:`!frozendict` preserves
insertion order, but comparison does not take order into account.
For example::
@ -1273,7 +1276,7 @@ csv
.. _whatsnew315-jit:
Upgraded JIT compiler
=====================
---------------------
Results from the `pyperformance <https://github.com/python/pyperformance>`__
benchmark suite report
@ -1438,6 +1441,8 @@ threading
typing
------
.. _whatsnew315-typeform:
* :pep:`747`: Add :data:`~typing.TypeForm`, a new special form for annotating
values that are themselves type expressions.
``TypeForm[T]`` means "a type form object describing ``T`` (or a type
@ -1636,7 +1641,7 @@ New features
and :c:data:`Py_mod_abi`.
(Contributed by Petr Viktorin in :gh:`137210`.)
.. _whatsnew315-pep782:
.. _whatsnew315-pybyteswriter:
* Implement :pep:`782`, the :ref:`PyBytesWriter API <pybyteswriter>`.
Add functions: