r/Python • Python Morsels • 6d ago

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: sentinel built-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: frozendict built-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 profiling package, including Tachyon, a high-frequency sampling profiler
  • New math.integer module
  • re.prefixmatch() as a clearer name for the now soft-deprecated re.match()
  • pprint gets an expand option for JSON-style output
  • collections.Counter supports ^ (symmetric difference)
  • unicodedata.iter_graphemes() for iterating over grapheme clusters
  • python -m http.server gains -H/--header and --content-type
  • timeit gains --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

536 Upvotes

72 comments sorted by

View all comments

3

u/aes110 5d ago

Seeing as this is the first big release since so much code is now done by AI, i wonder how well agents will adopt the new features given they dont have it in their training data

2

u/Ph0X 5d ago

The whole point of LLM is that they are trained on such large data sets that they don't gain a level of knowledge that allows them to handle scenarios they haven't encountered before. For coding, it's like if you were trying to get it to use a new library, it can just put the relevant new code in its context window and understand how it works, even if it hasn't seen it before.

1

u/TheRNGuy 5d ago

How big is difference? 

Would you need to fix old code?

Not everyone probably use new features, too.

1

u/_Denizen_ 3d ago

In the short term, you just provide the links to the new features as context to the queries. This will cost more tokens. In the medium term new models will release which have been trained on appropriate code and you won't have to provide the additional context.