@@ -58,44 +58,49 @@ Summary -- Release highlights
58
58
.. This section singles out the most important changes in Python 3.11.
59
59
Brevity is key.
60
60
61
- - Python 3.11 is between 10-60% faster than Python 3.10. On average, we measured a
62
- 1.25x speedup on the standard benchmark suite. See `Faster CPython `_ for details.
61
+ * Python 3.11 is between 10-60% faster than Python 3.10.
62
+ On average, we measured a 1.25x speedup on the standard benchmark suite.
63
+ See :ref: `whatsnew311-faster-cpython ` for details.
63
64
64
65
.. PEP-sized items next.
65
66
66
67
New syntax features:
67
68
68
- * :pep: ` 654 `: Exception Groups and `` except* ``.
69
+ * :ref: ` whatsnew311-pep654 `
69
70
70
71
New built-in features:
71
72
72
- * :pep: ` 678 `: Enriching Exceptions with Notes.
73
+ * :ref: ` whatsnew311-pep678 `
73
74
74
75
New standard library modules:
75
76
76
- * :pep: `680 `: ``tomllib `` — Support for Parsing TOML in the Standard Library.
77
+ * :pep: `680 `: :mod: `tomllib ` —
78
+ Support for parsing `TOML <https://toml.io/ >`_ in the Standard Library
77
79
78
80
Interpreter improvements:
79
81
80
- * :pep: ` 657 `: Include Fine Grained Error Locations in Tracebacks.
82
+ * :ref: ` whatsnew311-pep657 `
81
83
* New :option: `-P ` command line option and :envvar: `PYTHONSAFEPATH ` environment
82
- variable to disable automatically prepending a potentially unsafe path
83
- (the working dir or script directory, depending on invocation)
84
- to :data: `sys.path `.
84
+ variable to :ref: `disable automatically prepending potentially unsafe paths
85
+ <whatsnew311-pythonsafepath>` to :data: `sys.path `
85
86
86
87
New typing features:
87
88
88
- * :pep: ` 646 `: Variadic generics.
89
- * :pep: ` 655 `: Marking individual TypedDict items as required or potentially missing.
90
- * :pep: ` 673 `: `` Self `` type.
91
- * :pep: ` 675 `: Arbitrary literal string type.
92
- * :pep: ` 681 `: Data Class Transforms.
89
+ * :ref: ` whatsnew311-pep646 `
90
+ * :ref: ` whatsnew311-pep655 `
91
+ * :ref: ` whatsnew311-pep673 `
92
+ * :ref: ` whatsnew311-pep675 `
93
+ * :ref: ` whatsnew311-pep681 `
93
94
94
- Important deprecations, removals or restrictions:
95
+ Important deprecations, removals and restrictions:
95
96
96
- * :pep: `594 `: Removing dead batteries from the standard library.
97
- * :pep: `624 `: Remove ``Py_UNICODE `` encoder APIs.
98
- * :pep: `670 `: Convert macros to functions in the Python C API.
97
+ * :pep: `594 `:
98
+ :ref: `Many legacy standard library modules have been deprecated
99
+ <whatsnew311-pep594>` and will be removed in Python 3.13
100
+ * :pep: `624 `:
101
+ :ref: `Py_UNICODE encoder APIs have been removed <whatsnew311-pep624 >`
102
+ * :pep: `670 `:
103
+ :ref: `Macros converted to static inline functions <whatsnew311-pep670 >`
99
104
100
105
101
106
.. _whatsnew311-features :
@@ -105,8 +110,8 @@ New Features
105
110
106
111
.. _whatsnew311-pep657 :
107
112
108
- PEP 657: Enhanced error locations in tracebacks
109
- -----------------------------------------------
113
+ PEP 657: Fine-grained error locations in tracebacks
114
+ ---------------------------------------------------
110
115
111
116
When printing tracebacks, the interpreter will now point to the exact expression
112
117
that caused the error, instead of just the line. For example:
@@ -381,7 +386,7 @@ Kumar Srinivasan and Graham Bleaney.)
381
386
382
387
.. _whatsnew311-pep681 :
383
388
384
- PEP 681: Data Class Transforms
389
+ PEP 681: Data class transforms
385
390
------------------------------
386
391
387
392
:data: `~typing.dataclass_transform ` may be used to
@@ -457,6 +462,8 @@ Other Language Changes
457
462
pickles instance attributes implemented as :term: `slots <__slots__> `.
458
463
(Contributed by Serhiy Storchaka in :issue: `26579 `.)
459
464
465
+ .. _whatsnew311-pythonsafepath :
466
+
460
467
* Added a :option: `-P ` command line option
461
468
and a :envvar: `PYTHONSAFEPATH ` environment variable,
462
469
which disable the automatic prepending to :data: `sys.path `
@@ -1546,11 +1553,7 @@ Deprecated C APIs are :ref:`listed separately <whatsnew311-c-api-deprecated>`.
1546
1553
removed in Python 3.13. Use ``locale.setlocale(locale.LC_ALL, "") `` instead.
1547
1554
(Contributed by Victor Stinner in :gh: `90817 `.)
1548
1555
1549
- * The :mod: `asynchat `, :mod: `asyncore ` and :mod: `smtpd ` modules have been
1550
- deprecated since at least Python 3.6. Their documentation and deprecation
1551
- warnings have now been updated to note they will removed in Python 3.12
1552
- (:pep: `594 `).
1553
- (Contributed by Hugo van Kemenade in :issue: `47022 `.)
1556
+ .. _whatsnew311-pep594 :
1554
1557
1555
1558
* :pep: `594 ` led to the deprecations of the following modules which are
1556
1559
slated for removal in Python 3.13:
@@ -1578,6 +1581,11 @@ Deprecated C APIs are :ref:`listed separately <whatsnew311-c-api-deprecated>`.
1578
1581
(Contributed by Brett Cannon in :issue: `47061 ` and Victor Stinner in
1579
1582
:gh: `68966 `.)
1580
1583
1584
+ * The :mod: `asynchat `, :mod: `asyncore ` and :mod: `smtpd ` modules have been
1585
+ deprecated since at least Python 3.6. Their documentation and deprecation
1586
+ warnings have now been updated to note they will removed in Python 3.12.
1587
+ (Contributed by Hugo van Kemenade in :issue: `47022 `.)
1588
+
1581
1589
* More strict rules will be applied now applied for numerical group references
1582
1590
and group names in regular expressions in future Python versions.
1583
1591
Only sequence of ASCII digits will be now accepted as a numerical reference.
@@ -1970,6 +1978,8 @@ New Features
1970
1978
Porting to Python 3.11
1971
1979
----------------------
1972
1980
1981
+ .. _whatsnew311-pep670 :
1982
+
1973
1983
* Some macros have been converted to static inline functions to avoid
1974
1984
`macro pitfalls <https://gcc.gnu.org/onlinedocs/cpp/Macro-Pitfalls.html >`_.
1975
1985
The change should be mostly transparent to users,
@@ -2378,6 +2388,8 @@ Removed
2378
2388
API).
2379
2389
(Contributed by Victor Stinner in :issue: `45412 `.)
2380
2390
2391
+ .. _whatsnew311-pep624 :
2392
+
2381
2393
* Remove the :c:type: `Py_UNICODE ` encoder APIs,
2382
2394
as they have been deprecated since Python 3.3,
2383
2395
are little used
0 commit comments