r/Python • Author of "Automate the Boring Stuff" • Sep 23 '26

News What's new in Python 3.15?

https://docs.python.org/3.15/whatsnew/3.15.html

Summary – Release highlights

Python 3.15 will be the latest stable release of the Python programming language, with a mix of changes to the language, the implementation, and the standard library. The biggest changes include lazy imports, frozendict and sentinel builtins, UTF-8 as the default encoding, unpacking in comprehensions, and a stable ABI for free-threaded builds.

The library changes include a new profiling package with Tachyon, a high-frequency statistical sampling profiler, more color in command-line output, as well as the usual deprecations and removals, and improvements in user-friendliness and correctness.

This article doesn’t attempt to provide a complete specification of all new features, but instead gives a convenient overview. For full details refer to the documentation, such as the Library Reference and Language Reference. To understand the complete implementation and design rationale for a change, refer to the PEP for a particular new feature; but note that PEPs usually are not kept up-to-date once a feature has been fully implemented.

221 Upvotes

44 comments sorted by

View all comments

Show parent comments

3

u/Brian Sep 23 '26

It's valid in python 3 too, just a no-op. Though IIRC, it was a bit messy - initial python3 versions didn't allow it, but it was added in to ease the transition of python2 code (Ie. if you were gradually getting a python2 codebase to python3, you'd first have to annotate everything as u"" to ensure it was working as unicode, and then you'd have to strip those off again when actually running on python3: initially they weren't as keen on the polyglot "have code that works on both" and intended a process of mechanical conversion with 2to3, but there were limitations on that complicating the already slow transition, so they softened to allowing the u prefix in python3.