33 What's New In Python 3.13
44****************************
55
6- :Editor: Thomas Wouters
6+ :Editors: Adam Turner and Thomas Wouters
77
88.. Rules for maintenance:
99
@@ -53,12 +53,6 @@ For full details, see the :ref:`changelog <changelog>`.
5353
5454 :pep: `719 ` -- Python 3.13 Release Schedule
5555
56- .. note ::
57-
58- Prerelease users should be aware that this document is currently in draft
59- form. It will be updated substantially as Python 3.13 moves towards release,
60- so it's worth checking back even after reading earlier versions.
61-
6256
6357Summary -- Release Highlights
6458=============================
@@ -142,7 +136,7 @@ Significant improvements in the standard library:
142136* The :mod: `copy ` module now has a :func: `copy.replace ` function,
143137 with support for many builtin types and any class defining
144138 the :func: `~object.__replace__ ` method.
145- * The :mod: `dbm.sqlite3 ` module is now the default :mod: `dbm ` backend.
139+ * The new :mod: `dbm.sqlite3 ` module is now the default :mod: `dbm ` backend.
146140* The :mod: `os ` module has a :ref: `suite of new functions <os-timerfd >`
147141 for working with Linux's timer notification file descriptors.
148142* The :mod: `random ` module now has a :ref: `command-line interface <random-cli >`.
@@ -167,7 +161,7 @@ New typing features:
167161* :pep: `696 `: Type parameters (:data: `typing.TypeVar `, :data: `typing.ParamSpec `,
168162 and :data: `typing.TypeVarTuple `) now support defaults.
169163* :pep: `702 `: The new :func: `warnings.deprecated ` decorator adds support
170- for marking deprecations in the type system.
164+ for marking deprecations in the type system and at runtime .
171165* :pep: `705 `: :data: `typing.ReadOnly ` can be used to mark an item of a
172166 :class: `typing.TypedDict ` as read-only for type checkers.
173167* :pep: `742 `: :data: `typing.TypeIs ` provides more intuitive
@@ -177,23 +171,23 @@ Platform support:
177171
178172* :pep: `730 `: Apple's iOS is now an :ref: `officially supported platform
179173 <whatsnew313-platform-support>`, at :pep: `tier 3 <11#tier-3 >`.
180- Official Android support (:pep: `738 `) is in the works as well .
174+ Official Android support (:pep: `738 `) is also in the works.
181175* ``wasm32-wasi `` is now supported as a :pep: `tier 2 <11#tier-2 >` platform.
182176* ``wasm32-emscripten `` is no longer an officially supported platform.
183177
184178Important removals:
185179
186180* :ref: `PEP 594 <whatsnew313-pep594 >`: The remaining 19 "dead batteries"
187- have been removed from the standard library:
181+ (legacy stdlib modules) have been removed from the standard library:
188182 :mod: `!aifc `, :mod: `!audioop `, :mod: `!cgi `, :mod: `!cgitb `, :mod: `!chunk `,
189183 :mod: `!crypt `, :mod: `!imghdr `, :mod: `!mailcap `, :mod: `!msilib `, :mod: `!nis `,
190184 :mod: `!nntplib `, :mod: `!ossaudiodev `, :mod: `!pipes `, :mod: `!sndhdr `,
191185 :mod: `!spwd `, :mod: `!sunau `, :mod: `!telnetlib `, :mod: `!uu ` and :mod: `!xdrlib `.
192186* Remove the :program: `2to3 ` tool and :mod: `!lib2to3 ` module
193187 (deprecated in Python 3.11).
194188* Remove the :mod: `!tkinter.tix ` module (deprecated in Python 3.6).
195- * Remove :func: `!locale.resetlocale `.
196- * Remove :mod: `!typing.io ` and :mod: `!typing.re `.
189+ * Remove the :func: `!locale.resetlocale ` function .
190+ * Remove the :mod: `!typing.io ` and :mod: `!typing.re ` namespaces .
197191* Remove chained :class: `classmethod ` descriptors.
198192
199193Release schedule changes:
@@ -338,7 +332,7 @@ designed with threading in mind will run faster on multi-core hardware.
338332expect some bugs and a substantial single-threaded performance hit.
339333Free-threaded builds of CPython support optionally running with the GIL
340334enabled at runtime using the environment variable :envvar: `PYTHON_GIL ` or
341- the command-line option :option: `-X gil `.
335+ the command-line option :option: `-X gil=1 `.
342336
343337To check if the current interpreter supports free-threading, :option: `python -VV <-V> `
344338and :attr: `sys.version ` contain "experimental free-threading build".
@@ -439,14 +433,14 @@ Defined mutation semantics for :py:func:`locals`
439433Historically, the expected result of mutating the return value of
440434:func: `locals ` has been left to individual Python implementations to define.
441435Starting from Python 3.13, :pep: `667 ` standardises
442- the historical behaviour of CPython for most code execution scopes,
436+ the historical behavior of CPython for most code execution scopes,
443437but changes :term: `optimized scopes <optimized scope> `
444438(functions, generators, coroutines, comprehensions, and generator expressions)
445439to explicitly return independent snapshots of the currently assigned local
446440variables, including locally referenced nonlocal variables captured in closures.
447441
448442This change to the semantics of :func: `locals ` in optimized scopes also
449- affects the default behaviour of code execution functions that implicitly
443+ affects the default behavior of code execution functions that implicitly
450444target :func: `!locals ` if no explicit namespace is provided
451445(such as :func: `exec ` and :func: `eval `).
452446In previous versions, whether or not changes could be accessed by calling
@@ -610,6 +604,9 @@ Other Language Changes
610604 the value of the *optimize * argument.
611605 (Contributed by Irit Katriel in :gh: `108113 `).
612606
607+ * Add a :attr: `~property.__name__ ` attribute on :class: `property ` objects.
608+ (Contributed by Eugene Toder in :gh: `101860 `.)
609+
613610* Add :exc: `PythonFinalizationError `, a new exception derived from
614611 :exc: `RuntimeError ` and used to signal when operations are blocked
615612 during :term: `finalization <interpreter shutdown> `.
@@ -636,9 +633,6 @@ Other Language Changes
636633 the :mod: `bz2 `, :mod: `lzma `, :mod: `tarfile `, and :mod: `zipfile ` modules.
637634 (Contributed by Serhiy Storchaka in :gh: `115961 `.)
638635
639- * Add a :attr: `~property.__name__ ` attribute on :class: `property ` objects.
640- (Contributed by Eugene Toder in :gh: `101860 `.)
641-
642636
643637New Modules
644638===========
678672
679673* The constructors of node types in the :mod: `ast ` module are now
680674 stricter in the arguments they accept,
681- with more intuitive behaviour when arguments are omitted.
675+ with more intuitive behavior when arguments are omitted.
682676
683677 If an optional field on an AST node is not included as an argument when
684678 constructing an instance, the field will now be set to ``None ``. Similarly,
@@ -889,7 +883,7 @@ email
889883 return ``('', '') `` pairs in more situations where invalid email addresses
890884 are encountered instead of potentially inaccurate values.
891885 The two functions have a new optional *strict * parameter (default ``True ``).
892- To get the old behaviour (accepting malformed input), use ``strict=False ``.
886+ To get the old behavior (accepting malformed input), use ``strict=False ``.
893887 ``getattr(email.utils, 'supports_strict_parsing', False) `` can be used
894888 to check if the *strict * parameter is available.
895889 (Contributed by Thomas Dwyer and Victor Stinner for :gh: `102988 ` to improve
@@ -2055,7 +2049,7 @@ New Features
20552049 (Contributed by Victor Stinner and Petr Viktorin in :gh: `110850 `.)
20562050
20572051* Add the :c:func: `PyDict_ContainsString ` function
2058- with the same behaviour as :c:func: `PyDict_Contains `,
2052+ with the same behavior as :c:func: `PyDict_Contains `,
20592053 but *key * is specified as a :c:expr: `const char* ` UTF-8 encoded bytes string,
20602054 rather than a :c:expr: `PyObject* `.
20612055 (Contributed by Victor Stinner in :gh: `108314 `.)
@@ -2585,7 +2579,7 @@ Changes in the Python API
25852579
25862580 * Calling :func: `locals ` in an :term: `optimized scope ` now produces an
25872581 independent snapshot on each call, and hence no longer implicitly updates
2588- previously returned references. Obtaining the legacy CPython behaviour now
2582+ previously returned references. Obtaining the legacy CPython behavior now
25892583 requires explicit calls to update the initially returned dictionary with the
25902584 results of subsequent calls to :func: `!locals `. Code execution functions that
25912585 implicitly target :func: `!locals ` (such as ``exec `` and ``eval ``) must be
0 commit comments