11
22****************************
3- What's New In Python 3.14
3+ What's new in Python 3.14
44****************************
55
66:Editor: TBD
@@ -56,7 +56,7 @@ For full details, see the :ref:`changelog <changelog>`.
5656 so it's worth checking back even after reading earlier versions.
5757
5858
59- Summary -- Release highlights
59+ Summary -- release highlights
6060=============================
6161
6262.. This section singles out the most important changes in Python 3.14.
@@ -67,12 +67,12 @@ Summary -- Release highlights
6767
6868
6969
70- New Features
70+ New features
7171============
7272
73- .. _ whatsnew-314 -pep649 :
73+ .. _ whatsnew314 -pep649 :
7474
75- PEP 649: Deferred Evaluation of Annotations
75+ PEP 649: deferred evaluation of annotations
7676-------------------------------------------
7777
7878The :term: `annotations <annotation> ` on functions, classes, and modules are no
@@ -150,12 +150,12 @@ In Python 3.7, :pep:`563` introduced the ``from __future__ import annotations``
150150directive, which turns all annotations into strings. This directive is now
151151considered deprecated and it is expected to be removed in a future version of Python.
152152However, this removal will not happen until after Python 3.13, the last version of
153- Python without deferred evaluation of annotations, reaches its end of life.
153+ Python without deferred evaluation of annotations, reaches its end of life in 2029 .
154154In Python 3.14, the behavior of code using ``from __future__ import annotations ``
155155is unchanged.
156156
157157
158- Improved Error Messages
158+ Improved error messages
159159-----------------------
160160
161161* When unpacking assignment fails due to incorrect number of variables, the
@@ -172,16 +172,16 @@ Improved Error Messages
172172 ValueError: too many values to unpack (expected 3, got 4)
173173
174174
175- Other Language Changes
175+ Other language changes
176176======================
177177
178178* Incorrect usage of :keyword: `await ` and asynchronous comprehensions
179179 is now detected even if the code is optimized away by the :option: `-O `
180- command line option. For example, ``python -O -c 'assert await 1' ``
180+ command- line option. For example, ``python -O -c 'assert await 1' ``
181181 now produces a :exc: `SyntaxError `. (Contributed by Jelle Zijlstra in :gh: `121637 `.)
182182
183183* Writes to ``__debug__ `` are now detected even if the code is optimized
184- away by the :option: `-O ` command line option. For example,
184+ away by the :option: `-O ` command- line option. For example,
185185 ``python -O -c 'assert (__debug__ := 1)' `` now produces a
186186 :exc: `SyntaxError `. (Contributed by Irit Katriel in :gh: `122245 `.)
187187
@@ -191,15 +191,15 @@ Other Language Changes
191191 (Contributed by Serhiy Storchaka in :gh: `84978 `.)
192192
193193
194- New Modules
194+ New modules
195195===========
196196
197197* :mod: `annotationlib `: For introspecting :term: `annotations <annotation> `.
198198 See :pep: `749 ` for more details.
199199 (Contributed by Jelle Zijlstra in :gh: `119180 `.)
200200
201201
202- Improved Modules
202+ Improved modules
203203================
204204
205205argparse
214214---
215215
216216* Add :func: `ast.compare ` for comparing two ASTs.
217- (Contributed by Batuhan Taskaya and Jeremy Hylton in :issue: ` 15987 `.)
217+ (Contributed by Batuhan Taskaya and Jeremy Hylton in :gh: ` 60191 `.)
218218
219219* Add support for :func: `copy.replace ` for AST nodes.
220220 (Contributed by Bénédikt Tran in :gh: `121141 `.)
@@ -246,6 +246,12 @@ decimal
246246 :meth: `Decimal.from_number() <decimal.Decimal.from_number> `.
247247 (Contributed by Serhiy Storchaka in :gh: `121798 `.)
248248
249+ datetime
250+ --------
251+
252+ * Add :meth: `datetime.time.strptime ` and :meth: `datetime.date.strptime `.
253+ (Contributed by Wannes Boeykens in :gh: `41431 `.)
254+
249255dis
250256---
251257
254260 This feature is added to the following interfaces via the *show_positions *
255261 keyword argument:
256262
257- - :class: `dis.Bytecode `,
258- - :func: `dis.dis `, :func: `dis.distb `, and
259- - :func: `dis.disassemble `.
263+ - :class: `dis.Bytecode `
264+ - :func: `dis.dis `
265+ - :func: `dis.distb `
266+ - :func: `dis.disassemble `
260267
261268 This feature is also exposed via :option: `dis --show-positions `.
262269 (Contributed by Bénédikt Tran in :gh: `123165 `.)
310317 of the error.
311318 (Contributed by Serhiy Storchaka in :gh: `122163 `.)
312319
313- * Enable the :mod: `json ` module to work as a script using the :option: `-m ` switch: ``python -m json ``.
320+ * Enable the :mod: `json ` module to work as a script using the :option: `-m `
321+ switch: :program: `python -m json `.
314322 See the :ref: `JSON command-line interface <json-commandline >` documentation.
315323 (Contributed by Trey Hunner in :gh: `122873 `.)
316324
@@ -325,12 +333,6 @@ operator
325333 (Contributed by Raymond Hettinger and Nico Mexis in :gh: `115808 `.)
326334
327335
328- datetime
329- --------
330-
331- * Add :meth: `datetime.time.strptime ` and :meth: `datetime.date.strptime `.
332- (Contributed by Wannes Boeykens in :gh: `41431 `.)
333-
334336os
335337--
336338
@@ -357,11 +359,11 @@ pathlib
357359pdb
358360---
359361
360- * Hard-coded breakpoints (:func: `breakpoint ` and :func: `pdb.set_trace `) now
362+ * Hardcoded breakpoints (:func: `breakpoint ` and :func: `pdb.set_trace `) now
361363 reuse the most recent :class: `~pdb.Pdb ` instance that calls
362364 :meth: `~pdb.Pdb.set_trace `, instead of creating a new one each time.
363365 As a result, all the instance specific data like :pdbcmd: `display ` and
364- :pdbcmd: `commands ` are preserved across hard-coded breakpoints.
366+ :pdbcmd: `commands ` are preserved across hardcoded breakpoints.
365367 (Contributed by Tian Gao in :gh: `121450 `.)
366368
367369* Add a new argument *mode * to :class: `pdb.Pdb `. Disable the ``restart ``
@@ -391,9 +393,9 @@ symtable
391393
392394* Expose the following :class: `symtable.Symbol ` methods:
393395
394- * :meth: `~symtable.Symbol.is_free_class `
395- * :meth: `~symtable.Symbol.is_comp_iter `
396396 * :meth: `~symtable.Symbol.is_comp_cell `
397+ * :meth: `~symtable.Symbol.is_comp_iter `
398+ * :meth: `~symtable.Symbol.is_free_class `
397399
398400 (Contributed by Bénédikt Tran in :gh: `120029 `.)
399401
@@ -472,11 +474,11 @@ ast
472474* Remove the following classes. They were all deprecated since Python 3.8,
473475 and have emitted deprecation warnings since Python 3.12:
474476
475- * :class: `!ast.Num `
476- * :class: `!ast.Str `
477477 * :class: `!ast.Bytes `
478- * :class: `!ast.NameConstant `
479478 * :class: `!ast.Ellipsis `
479+ * :class: `!ast.NameConstant `
480+ * :class: `!ast.Num `
481+ * :class: `!ast.Str `
480482
481483 Use :class: `ast.Constant ` instead. As a consequence of these removals,
482484 user-defined ``visit_Num ``, ``visit_Str ``, ``visit_Bytes ``,
@@ -501,16 +503,16 @@ asyncio
501503* Remove the following classes and functions. They were all deprecated and
502504 emitted deprecation warnings since Python 3.12:
503505
506+ * :func: `!asyncio.get_child_watcher `
507+ * :func: `!asyncio.set_child_watcher `
508+ * :meth: `!asyncio.AbstractEventLoopPolicy.get_child_watcher `
509+ * :meth: `!asyncio.AbstractEventLoopPolicy.set_child_watcher `
504510 * :class: `!asyncio.AbstractChildWatcher `
505- * :class: `!asyncio.SafeChildWatcher `
506- * :class: `!asyncio.MultiLoopChildWatcher `
507511 * :class: `!asyncio.FastChildWatcher `
508- * :class: `!asyncio.ThreadedChildWatcher `
512+ * :class: `!asyncio.MultiLoopChildWatcher `
509513 * :class: `!asyncio.PidfdChildWatcher `
510- * :meth: `!asyncio.AbstractEventLoopPolicy.get_child_watcher `
511- * :meth: `!asyncio.AbstractEventLoopPolicy.set_child_watcher `
512- * :func: `!asyncio.get_child_watcher `
513- * :func: `!asyncio.set_child_watcher `
514+ * :class: `!asyncio.SafeChildWatcher `
515+ * :class: `!asyncio.ThreadedChildWatcher `
514516
515517 (Contributed by Kumar Aditya in :gh: `120804 `.)
516518
@@ -623,14 +625,14 @@ Changes in the Python API
623625 (Contributed by Serhiy Storchaka in :gh: `69998 `.)
624626
625627
626- Build Changes
628+ Build changes
627629=============
628630
629631
630- C API Changes
632+ C API changes
631633=============
632634
633- New Features
635+ New features
634636------------
635637
636638* Add :c:func: `PyLong_GetSign ` function to get the sign of :class: `int ` objects.
@@ -640,17 +642,17 @@ New Features
640642 object:
641643
642644 * :c:func: `PyUnicodeWriter_Create `
645+ * :c:func: `PyUnicodeWriter_DecodeUTF8Stateful `
643646 * :c:func: `PyUnicodeWriter_Discard `
644647 * :c:func: `PyUnicodeWriter_Finish `
648+ * :c:func: `PyUnicodeWriter_Format `
645649 * :c:func: `PyUnicodeWriter_WriteChar `
646- * :c:func: `PyUnicodeWriter_WriteUTF8 `
647- * :c:func: `PyUnicodeWriter_WriteUCS4 `
648- * :c:func: `PyUnicodeWriter_WriteWideChar `
649- * :c:func: `PyUnicodeWriter_WriteStr `
650650 * :c:func: `PyUnicodeWriter_WriteRepr `
651+ * :c:func: `PyUnicodeWriter_WriteStr `
651652 * :c:func: `PyUnicodeWriter_WriteSubstring `
652- * :c:func: `PyUnicodeWriter_Format `
653- * :c:func: `PyUnicodeWriter_DecodeUTF8Stateful `
653+ * :c:func: `PyUnicodeWriter_WriteUCS4 `
654+ * :c:func: `PyUnicodeWriter_WriteUTF8 `
655+ * :c:func: `PyUnicodeWriter_WriteWideChar `
654656
655657 (Contributed by Victor Stinner in :gh: `119182 `.)
656658
@@ -671,14 +673,14 @@ New Features
671673* Add new functions to convert C ``<stdint.h> `` numbers from/to Python
672674 :class: `int `:
673675
674- * :c:func: `PyLong_FromInt32 `
675- * :c:func: `PyLong_FromInt64 `
676- * :c:func: `PyLong_FromUInt32 `
677- * :c:func: `PyLong_FromUInt64 `
678676 * :c:func: `PyLong_AsInt32 `
679677 * :c:func: `PyLong_AsInt64 `
680678 * :c:func: `PyLong_AsUInt32 `
681679 * :c:func: `PyLong_AsUInt64 `
680+ * :c:func: `PyLong_FromInt32 `
681+ * :c:func: `PyLong_FromInt64 `
682+ * :c:func: `PyLong_FromUInt32 `
683+ * :c:func: `PyLong_FromUInt64 `
682684
683685 (Contributed by Victor Stinner in :gh: `120389 `.)
684686
@@ -701,20 +703,20 @@ New Features
701703
702704* Add functions to configure the Python initialization (:pep: `741 `):
703705
706+ * :c:func: `Py_InitializeFromInitConfig `
707+ * :c:func: `PyInitConfig_AddModule `
704708 * :c:func: `PyInitConfig_Create `
705709 * :c:func: `PyInitConfig_Free `
710+ * :c:func: `PyInitConfig_FreeStrList `
706711 * :c:func: `PyInitConfig_GetError `
707712 * :c:func: `PyInitConfig_GetExitCode `
708- * :c:func: `PyInitConfig_HasOption `
709713 * :c:func: `PyInitConfig_GetInt `
710714 * :c:func: `PyInitConfig_GetStr `
711715 * :c:func: `PyInitConfig_GetStrList `
712- * :c:func: `PyInitConfig_FreeStrList `
716+ * :c:func: `PyInitConfig_HasOption `
713717 * :c:func: `PyInitConfig_SetInt `
714718 * :c:func: `PyInitConfig_SetStr `
715719 * :c:func: `PyInitConfig_SetStrList `
716- * :c:func: `PyInitConfig_AddModule `
717- * :c:func: `Py_InitializeFromInitConfig `
718720
719721 (Contributed by Victor Stinner in :gh: `107954 `.)
720722
0 commit comments