by nickcw on 7/6/24, 10:14 AM with 22 comments
by omerhac on 7/6/24, 11:32 AM
by xcmark on 7/6/24, 12:05 PM
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).
by bentinata on 7/6/24, 12:19 PM
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.
by hprotagonist on 7/6/24, 12:17 PM
Ned’s list is what I usually use.
by ptmcg on 7/6/24, 2:04 PM
```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).
by m1r3k on 7/6/24, 11:52 AM
I didn't know about the pyupgrade tool. Very useful.
by the__alchemist on 7/6/24, 12:18 PM
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.
by screye on 7/6/24, 12:37 PM
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 .
by stenius on 7/6/24, 12:35 PM
I've missed a lot of these that I'm going to take advantage of!
by rubslopes on 7/6/24, 2:31 PM