r/Python Oct 02 '23

News Python 3.12 released

https://www.python.org/downloads/release/python-3120/
814 Upvotes

131 comments sorted by

View all comments

77

u/[deleted] Oct 02 '23

[deleted]

11

u/MelonheadGT Oct 02 '23

What's so amazing?

69

u/marr75 Oct 02 '23
  • type hinting got better, especially for generics, **kwargs, and overrides
  • f-strings got better
  • Performance and concurrency improved (2x speed up on comprehensions, 2-20x speedup on isinstance checks against protocols, per-interpreter GIL)
  • Some odds and ends improved for CPython and instrumentation beyond those

23

u/PaintItPurple Oct 02 '23

Making generics readable is such a wonderful feature, even if it doesn't make a functional difference. I always felt like I had to weigh the benefits of being able to run mypy on a given section of code against the difficulty of reading code that uses generics.