What’s New In Python 3.12

Release

3.12.0a0

Date

May 09, 2022

This article explains the new features in Python 3.12, compared to 3.11.

For full details, see the changelog.

Note

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

Summary – Release highlights

New Features

Other Language Changes

New Modules

  • None yet.

Improved Modules

Optimizations

Deprecated

Removed

Porting to Python 3.12

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

Changes in the Python API

  • More strict rules are now applied for numerical group references and group names in regular expressions. Only sequence of ASCII digits is now accepted as a numerical reference. The group name in bytes patterns and replacement strings can now only contain ASCII letters and digits and underscore. (Contributed by Serhiy Storchaka in gh-91760.)

Build Changes

C API Changes

New Features

Porting to Python 3.12

Deprecated

Removed

  • PyFrame_BlockSetup() and PyFrame_BlockPop() have been removed.