Wow this is much needed. Thanks!
I keep hearing rumors that a no GIL version is coming, I think this is probably the biggest change so far, as it would make the language much more performance oriented. I'm considering a tech stack and thinking about both python and Mojo for ML, not sure that Mojo is stable yet, but the performance differences are HUGE.
Interesting list. I need none of it except the guaranteed dict insertion order!
But of course, I have to learn all of it to understand other people's code. Python's syntax has really gotten worse. The match statement is ugly in comparison to functional languages, I'm not sure about f-strings, the with-statement extension adds new overhead to the reader.
Python is really like C++ now, except 50 times slower (yes, I know about the slow std::unordered_map special case that is due to its rigid specification).
They are on average great, but don't you agree that it's not always better? If the expressions get too long, it gets less readable than splitting the placeholders from those expressions.
Some of the linters don't know that and enforce f-strings. I know, we can't let the tools decide but sometimes that's just what happens at a workplace..
The walrus operator is pretty nice to have, the type system is absolutely necessary to improve correctness, and there are a few quality of life improvements that are great too, for example removeprefix().
I agree with the other comments - f-strings are worth using. Other than that, um, underscores in numeric literals are nice, especially for hex and binary.
I don’t think there’s anything else there that I want to use. But, I recognise that as someone who only uses Python for small dynamically-typed programs, I’m not the target audience for the language any more.
Agree that match is shite, Python has a Guido-induced antagonism towards functional programming, starting with the opposition to multi-line lambdas, then with the attempted assassination of map() and filter() in Python 3, the removal of argument pattern matching, and now with statement-based match (in 2024!).
I agree that f-strings have gone to town with itself. I do like the parenthesis support for with-statement, though: it gives more structural support instead of splitting lines with trailing back slashes--I always have an uneasy feeling about trailing back slashes.
It was nice to see the "annotations" from 3.7 for helping avoid types with circular imports (for types). I didn't know that!
I'd love to see a step further, and avoid the circular import problem entirely. It's something I fight with everything time I work in Python. I find that I am forced to structure my Python programs in a way specifically designed to avoid this instead of what makes sense for organization. Or I will C+P functions if I feel that tradeoff is not worth it.
As someone who haven't been using Python extensively since college, and mostly use TypeScript and Kotlin at work (and little bit of Rust for hobby projects), that's a lot of typing features. It feels like for the past few years typing been getting more attention. Good to see.
I used to hate TypeScript (circa 2016) because it kept bugging me with typing errors, and I used to sprinkle "any" to shut it up.
```python
if header.startswith("X-Forwarded-"):
section = header.removeprefix("X-Forwarded-")
```
the `startswith()` check is unnecessary. If `header` doesn't start with "X-Forwarded-" then `header.removeprefix("X-Forwarded-")` just returns `header`.
23 comments
[ 2.4 ms ] story [ 62.0 ms ] thread3.13 release note : https://docs.python.org/3.13/whatsnew/3.13.html
no-gil PEP https://peps.python.org/pep-0703/#backwards-compatibility
I didn't know about the pyupgrade tool. Very useful.
But of course, I have to learn all of it to understand other people's code. Python's syntax has really gotten worse. The match statement is ugly in comparison to functional languages, I'm not sure about f-strings, the with-statement extension adds new overhead to the reader.
Python is really like C++ now, except 50 times slower (yes, I know about the slow std::unordered_map special case that is due to its rigid specification).
Yet there is still a common belief among programmers that “Python is a simple language”. I don’t know how that persists.
Perhaps what people really mean is just that it has “friendly” syntax (no braces, sigils etc) - and they aren’t considering semantics?
I don’t think there’s anything else there that I want to use. But, I recognise that as someone who only uses Python for small dynamically-typed programs, I’m not the target audience for the language any more.
Agree that match is shite, Python has a Guido-induced antagonism towards functional programming, starting with the opposition to multi-line lambdas, then with the attempted assassination of map() and filter() in Python 3, the removal of argument pattern matching, and now with statement-based match (in 2024!).
Ned’s list is what I usually use.
I'd love to see a step further, and avoid the circular import problem entirely. It's something I fight with everything time I work in Python. I find that I am forced to structure my Python programs in a way specifically designed to avoid this instead of what makes sense for organization. Or I will C+P functions if I feel that tradeoff is not worth it.
I used to hate TypeScript (circa 2016) because it kept bugging me with typing errors, and I used to sprinkle "any" to shut it up.
I've missed a lot of these that I'm going to take advantage of!
The piping and typing changes are so useful ! Bookmarked and I'll be coming back to this often.
I also caught the sleep token references. Well done .
```python if header.startswith("X-Forwarded-"): section = header.removeprefix("X-Forwarded-") ```
the `startswith()` check is unnecessary. If `header` doesn't start with "X-Forwarded-" then `header.removeprefix("X-Forwarded-")` just returns `header`.
Nice summary doc, with good examples. You can also visit [this site of mine](https://ptmcg.pythonanywhere.com/python_nutshell_app_a_searc...) to search for changes by version (3.7-3.11).