Skip to content

Latest commit

 

History

History
603 lines (421 loc) · 18.6 KB

File metadata and controls

603 lines (421 loc) · 18.6 KB

What's New In Python 3.14

Editor:TBD

This article explains the new features in Python 3.14, compared to 3.13.

For full details, see the :ref:`changelog <changelog>`.

Note

Prerelease users should be aware that this document is currently in draft form. It will be updated substantially as Python 3.14 moves towards release, so it's worth checking back even after reading earlier versions.

Summary -- Release highlights

New Features

Improved Error Messages

  • When unpacking assignment fails due to incorrect number of variables, the error message prints the received number of values in more cases than before. (Contributed by Tushar Sadhwani in :gh:`122239`.)

    >>> x, y, z = 1, 2, 3, 4
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
        x, y, z = 1, 2, 3, 4
        ^^^^^^^
    ValueError: too many values to unpack (expected 3, got 4)

Other Language Changes

New Modules

  • None yet.

Improved Modules

ast

ctypes

dis

fractions

Added support for converting any objects that have the :meth:`!as_integer_ratio` method to a :class:`~fractions.Fraction`. (Contributed by Serhiy Storchaka in :gh:`82017`.)

functools

http

Directory lists and error pages generated by the :mod:`http.server` module allow the browser to apply its default dark mode. (Contributed by Yorik Hansen in :gh:`123430`.)

json

Add notes for JSON serialization errors that allow to identify the source of the error. (Contributed by Serhiy Storchaka in :gh:`122163`.)

Enable :mod:`json` module to work as a script using the :option:`-m` switch: python -m json. See the :ref:`JSON command-line interface <json-commandline>` documentation. (Contributed by Trey Hunner in :gh:`122873`.)

operator

  • Two new functions operator.is_none and operator.is_not_none have been added, such that operator.is_none(obj) is equivalent to obj is None and operator.is_not_none(obj) is equivalent to obj is not None. (Contributed by Raymond Hettinger and Nico Mexis in :gh:`115808`.)

os

pathlib

pdb

pickle

symtable

unicodedata

  • The Unicode database has been updated to Unicode 16.0.0.

Optimizations

asyncio

  • :mod:`asyncio` now uses double linked list implementation for native tasks which speeds up execution by 10% on standard pyperformance benchmarks and reduces memory usage. (Contributed by Kumar Aditya in :gh:`107803`.)

Deprecated

Removed

argparse

ast

asyncio

collections.abc

email

importlib

itertools

pathlib

pty

sqlite3

typing

urllib

Others

Porting to Python 3.14

This section lists previously described changes and other bugfixes that may require changes to your code.

Changes in the Python API

Build Changes

C API Changes

New Features

Porting to Python 3.14

  • In the limited C API 3.14 and newer, :c:func:`Py_TYPE` is now implemented as an opaque function call to hide implementation details. (Contributed by Victor Stinner in :gh:`120600`.)

Deprecated

Removed