Skip to content

Latest commit

 

History

History
406 lines (275 loc) · 12.3 KB

File metadata and controls

406 lines (275 loc) · 12.3 KB

What's new in Python 3.15

Editor:TBD

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

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.15 moves towards release, so it's worth checking back even after reading earlier versions.

Summary --- release highlights

New features

Other language changes

  • Several error messages incorrectly using the term "argument" have been corrected. (Contributed by Stan Ulbrych in :gh:`133382`.)

New modules

  • None yet.

Improved modules

dbm

difflib

math

os.path

shelve

sqlite3

ssl

tarfile

traceback

  • Add new show_lines and recent_first keyword only arguments to the :mod:`traceback` functions.

    The show_lines argument controls whether source code lines are displayed. It is default to True.

    The recent_first argument controls whether the most recent frames are displayed first or last in the traceback. It affects wheher the exception is displayed at the top or bottom of the traceback. It is default to False. (Contributed by Inada Naoki in :gh:`135751`)

zlib

Optimizations

module_name

  • TODO

Deprecated

hashlib

  • In hash function constructors such as :func:`~hashlib.new` or the direct hash-named constructors such as :func:`~hashlib.md5` and :func:`~hashlib.sha256`, their optional initial data parameter could also be passed a keyword argument named data= or string= in various :mod:`hashlib` implementations.

    Support for the string keyword argument name is now deprecated and is slated for removal in Python 3.19. Prefer passing the initial data as a positional argument for maximum backwards compatibility.

    (Contributed by Bénédikt Tran in :gh:`134978`.)

Removed

ctypes

http.server

platform

sysconfig

threading

  • Remove support for arbitrary positional or keyword arguments in the C implementation of :class:`~threading.RLock` objects. This was deprecated in Python 3.14. (Contributed by Bénédikt Tran in :gh:`134087`.)

typing

  • The undocumented keyword argument syntax for creating :class:`~typing.NamedTuple` classes (for example, Point = NamedTuple("Point", x=int, y=int)) is no longer supported. Use the class-based syntax or the functional syntax instead. (Contributed by Bénédikt Tran in :gh:`133817`.)
  • Using TD = TypedDict("TD") or TD = TypedDict("TD", None) to construct a :class:`~typing.TypedDict` type with zero field is no longer supported. Use class TD(TypedDict): pass or TD = TypedDict("TD", {}) instead. (Contributed by Bénédikt Tran in :gh:`133823`.)

wave

Porting to Python 3.15

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

Build changes

C API changes

New features

Porting to Python 3.15

Deprecated C APIs

  • TODO

Removed C APIs

The following functions are removed in favor of :c:func:`PyConfig_Get`. The pythoncapi-compat project can be used to get :c:func:`!PyConfig_Get` on Python 3.13 and older.