Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions Doc/whatsnew/3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,30 @@ 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>`


New features
============

.. _whatsnew315-pep810:
.. _whatsnew315-lazy-imports:

:pep:`810`: Explicit lazy imports
---------------------------------
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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::
Expand Down Expand Up @@ -1273,7 +1276,7 @@ csv
.. _whatsnew315-jit:

Upgraded JIT compiler
=====================
---------------------

Results from the `pyperformance <https://github.com/python/pyperformance>`__
benchmark suite report
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
Loading