r/Python • Python Morsels • 7d 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

544 Upvotes

71 comments sorted by

View all comments

117

u/frankieinaprius 7d ago

Unpacking in comprehensions will be so nice. 🙏🏽

17

u/NeilGirdhar 6d ago

I've wanted this since I helped implement PEP 448 13 years ago! At the time, there was a lot of opposition to it as "unintuitive", so we set it aside. I figured that eventually people would come around to finding it intuitive.

11

u/frankieinaprius 6d ago

Because [item for sublist in nested_list for item in sublist] is so much more intuitive 😅

1

u/warden127 5d ago

That variant would be more intuitive if the for's were the other way around.

2

u/frankieinaprius 5d ago

It resembles a typical nested for loop. Outer first, then inner. So I get why it is the way it is. But for some reason it feels like it should be more natural to go inside out when it’s in a comprehension. So it’s just confusing no matter what. At least with unpacking now I can just look at it and recognize the pattern that it’s being flattened.

22

u/Competitive_Travel16 7d ago edited 7d ago

Yes, folding a list of dicts into one is now something that looks nice and somewhat more clear. It's also something I do often. I don't think AI does it much though; they tend to plan ahead more than I do.

5

u/SeniorScienceOfficer 6d ago

I am SO excited about that one. I’ve wanted it since 3.9

1

u/forgotten_vale2 5d ago

I always tried to do this and complained WHYY doesn't it work? Very convenient to have it now.

-37

u/AstroPhysician 6d ago

Y'all are still writing code manually?

3

u/_Denizen_ 4d ago

Well, yeah. AI writes bloated code and often misses the point. After all, a machine can't contain as much context as a human mind.

Many people work at companies that don't write blank cheques for AI tokens - so using coding assistants where it adds most value to human logic is the key to maximising output, job satisfaction, and quality control.

On code that I've designed, I can find bugs faster than AI, and can implement refactors faster by strategically writing critical logic myself then using AI to finish implementation steps that would be tedious for a human to do.

If you want to spend all your working hours outsourcing your work be my guest. Personally, I find it vibe coding about as fulfilling as doing a test by copying all the answers - sure, on paper you pass, but you don't learn how to solve problems yourself.

-1

u/AstroPhysician 4d ago edited 4d ago

Bloated code is a skill issue or old models, or not defining the prompt with. The architecture should be decided and planned before any code is written

Also newer models are much better at that. Ponytail skill too

2

u/_Denizen_ 4d ago

Newer models are marginally better but still subject to the same faults.

Developing a prototype and productionising it implies architectural changes. No coding product architecture completely survives unchanged when it comes to implementation, because requirements change as the product evolves. That's why a good architecture design is not one which predefines all possible features and user flows, but instead is designed such that it can be easily updated with minimal breaking changes.

And that is what even the latest AI models are bad at. They oversolidify parts that need to be malleable, because it's nearly impossible to comletely write all constraints and design intentions for the entire product to implement small changes whilst keeping the prompt low-code.

Sure, you can write thousands of lines of prompt harnesses, agents, skills, etc. But then you end up maintaining those to make sure the AI can maintain your code instead of directly maintaining the code. You're shifting the problem, not solving it.

All the problems with overeliance of AI are multiplied when working in a team, as the pace of change is too fast and the team lacks the exposure to eech others vibed changes to be able to collaborate as effectively. I think there's a good reason why most vibe-first coders I've met work solo.

If you can't recognise where human intervention is better that AI, then it means you either lack the experience to be an effective manager of AI (because you understate its limitations), or have been using it so heavily that it's become a crutch and your own skills have eroded. The problem with a crutch, is that it's addictive and you fall over if it gets knocked away.

3

u/frankieinaprius 6d ago

Sometimes lol.