@@ -66,27 +66,30 @@ Summary -- Release highlights
6666.. PEP-sized items next.
6767
6868 * :pep: `810 `: :ref: `Explicit lazy imports for faster startup times
69- <whatsnew315-pep810 >`
69+ <whatsnew315-lazy-imports >`
7070* :pep: `814 `: :ref: `Add frozendict built-in type
7171 <whatsnew315-frozendict>`
7272* :pep: `799 `: :ref: `A dedicated profiling package for organizing Python
7373 profiling tools <whatsnew315-profiling-package>`
7474* :pep: `799 `: :ref: `Tachyon: High frequency statistical sampling profiler
7575 <whatsnew315-sampling-profiler>`
76- * :pep: `798 `: :ref: `Unpacking in Comprehensions
76+ * :pep: `798 `: :ref: `Unpacking in comprehensions
7777 <whatsnew315-unpacking-in-comprehensions>`
7878* :pep: `686 `: :ref: `Python now uses UTF-8 as the default encoding
7979 <whatsnew315-utf8-default>`
80+ * :pep: `728 `: ``TypedDict `` with typed extra items
81+ * :pep: `747 `: :ref: `Annotating type forms with TypeForm
82+ <whatsnew315-typeform>`
8083* :pep: `782 `: :ref: `A new PyBytesWriter C API to create a Python bytes object
81- <whatsnew315-pep782 >`
84+ <whatsnew315-pybyteswriter >`
8285* :ref: `The JIT compiler has been significantly upgraded <whatsnew315-jit >`
8386* :ref: `Improved error messages <whatsnew315-improved-error-messages >`
8487
8588
8689New features
8790============
8891
89- .. _whatsnew315-pep810 :
92+ .. _whatsnew315-lazy-imports :
9093
9194:pep: `810 `: Explicit lazy imports
9295---------------------------------
@@ -120,12 +123,12 @@ name:
120123.. code-block :: python
121124
122125 lazy import json
123- lazy from datetime import datetime
126+ lazy from pathlib import Path
124127
125- print (" Starting up..." ) # json and datetime not loaded yet
128+ print (" Starting up..." ) # json and pathlib not loaded yet
126129
127- data = json.loads(' {"key": "value"}' ) # json gets loads here
128- now = datetime( ) # datetime loads here
130+ data = json.loads(' {"key": "value"}' ) # json loads here
131+ p = Path( " . " ) # pathlib loads here
129132
130133 This mechanism is particularly useful for applications that import many
131134modules at the top level but may only use a subset of them in any given run.
@@ -189,9 +192,9 @@ raise :exc:`SyntaxError`).
189192----------------------------------------
190193
191194A new :term: `immutable ` type, :class: `frozendict `, is added to the :mod: `builtins ` module.
192- It does not allow modification after creation. A `` frozendict ` ` is not a subclass of ``dict ``;
193- it inherits directly from ``object ``. A `` frozendict ` ` is :term: `hashable `
194- as long as all of its keys and values are hashable. A `` frozendict ` ` preserves
195+ It does not allow modification after creation. A :class: ` ! frozendict ` is not a subclass of ``dict ``;
196+ it inherits directly from ``object ``. A :class: ` ! frozendict ` is :term: `hashable `
197+ as long as all of its keys and values are hashable. A :class: ` ! frozendict ` preserves
195198insertion order, but comparison does not take order into account.
196199
197200For example::
@@ -1273,7 +1276,7 @@ csv
12731276.. _whatsnew315-jit :
12741277
12751278Upgraded JIT compiler
1276- =====================
1279+ ---------------------
12771280
12781281Results from the `pyperformance <https://github.com/python/pyperformance >`__
12791282benchmark suite report
@@ -1438,6 +1441,8 @@ threading
14381441typing
14391442------
14401443
1444+ .. _whatsnew315-typeform :
1445+
14411446* :pep: `747 `: Add :data: `~typing.TypeForm `, a new special form for annotating
14421447 values that are themselves type expressions.
14431448 ``TypeForm[T] `` means "a type form object describing ``T `` (or a type
@@ -1636,7 +1641,7 @@ New features
16361641 and :c:data: `Py_mod_abi `.
16371642 (Contributed by Petr Viktorin in :gh: `137210 `.)
16381643
1639- .. _whatsnew315-pep782 :
1644+ .. _whatsnew315-pybyteswriter :
16401645
16411646* Implement :pep: `782 `, the :ref: `PyBytesWriter API <pybyteswriter >`.
16421647 Add functions:
0 commit comments