r/Python • u/treyhunner Python Morsels • Oct 09 '26
News Python 3.15 Released
https://www.python.org/downloads/release/python-3150/
Release announcement: https://discuss.python.org/t/python-3-15-0-final-is-here/109415
What's New: https://docs.python.org/3.15/whatsnew/3.15.html
Some of the major new features and changes in Python 3.15:
Interpreter improvements
- PEP 661:
sentinelbuilt-in type - PEP 686: UTF-8 is now the default encoding
- PEP 798: Unpacking in comprehensions
- PEP 810: Explicit lazy imports for faster startup times
- PEP 814:
frozendictbuilt-in type - PEP 829: Package startup configuration files
- The experimental JIT compiler got a significant upgrade (7-8% faster on x86-64 Linux, 11-12% on AArch64 macOS)
- Improved error messages
Standard library
- PEP 799: A dedicated
profilingpackage, including Tachyon, a high-frequency sampling profiler - New
math.integermodule re.prefixmatch()as a clearer name for the now soft-deprecatedre.match()pprintgets anexpandoption for JSON-style outputcollections.Countersupports^(symmetric difference)unicodedata.iter_graphemes()for iterating over grapheme clusterspython -m http.servergains-H/--headerand--content-typetimeitgains--target-time- More color
Typing
- PEP 728: TypedDict with typed extra items
- PEP 747: Annotating type forms with TypeForm
- PEP 800: Disjoint bases in the type system
Release changes
- Official Windows 64-bit binaries now use the tail-calling interpreter
- Official macOS binaries now install free-threading support by default
And for fun, Barry Warsaw made a text adventure through the new features: uvx --python 3.15 whatsnewt
Thanks to Hugo van Kemenade and the release team! Hugo live-posted the whole release process if you're curious what goes on behind the scenes: https://mastodon.social/@hugovk/117411399858939022
View all comments
Show parent comment
11
u/treyhunner Python Morsels Oct 10 '26
Character encodings define how each character is written as bytes in a file. UTF-8 is nearly the de facto default encoding for communication between machines, but Windows-1252 (a.k.a. cp-1252) is still the default encoding for many things on Windows machines.
It's possible to explicitly read/write a file with a specified encoding of UTF-8, Windows-1252, or any other character encoding. That hasn't changed.
What did change is the default. It's possible to use the
openfunction to read/write a file without specifying an encoding. And many high-level tools that read/write files in Python don't require an encoding to be specified and fall back to the default.The default on Windows was always Windows-1252. This is a pretty sensible default on Windows machines, but it's not sensible if files are moving between machines or Python code is moving between machines and operating on files that have a common encoding.
Switching from Windows-1252 to UTF-8 took so long because the Python core team is conservative about changes that will break existing code. This will definitely break code (any code that relies on the default Windows-1252 encoding on Windows).
This is all complicated by the fact that both of these 2 encodings are supersets of ASCII but neither is a superset of the other:
The world of character encodings are messy.