TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Summary of Major Changes Between Python Versions

84 pointsby nickcw11 months ago

10 comments

omerhac10 months ago
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.
评论 #40889867 未加载
xcmark10 months ago
Interesting list. I need none of it except the guaranteed dict insertion order!<p>But of course, I have to learn all of it to understand other people&#x27;s code. Python&#x27;s syntax has really gotten worse. The match statement is ugly in comparison to functional languages, I&#x27;m not sure about f-strings, the with-statement extension adds new overhead to the reader.<p>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).
评论 #40889980 未加载
评论 #40890012 未加载
评论 #40890007 未加载
评论 #40889936 未加载
评论 #40889944 未加载
评论 #40896365 未加载
评论 #40889947 未加载
bentinata10 months ago
As someone who haven&#x27;t been using Python extensively since college, and mostly use TypeScript and Kotlin at work (and little bit of Rust for hobby projects), that&#x27;s a lot of typing features. It feels like for the past few years typing been getting more attention. Good to see.<p>I used to hate TypeScript (circa 2016) because it kept bugging me with typing errors, and I used to sprinkle &quot;any&quot; to shut it up.
hprotagonist10 months ago
<a href="https:&#x2F;&#x2F;nedbatchelder.com&#x2F;text&#x2F;which-py.html" rel="nofollow">https:&#x2F;&#x2F;nedbatchelder.com&#x2F;text&#x2F;which-py.html</a><p>Ned’s list is what I usually use.
ptmcg10 months ago
In this snippet<p>```python if header.startswith(&quot;X-Forwarded-&quot;): section = header.removeprefix(&quot;X-Forwarded-&quot;) ```<p>the `startswith()` check is unnecessary. If `header` doesn&#x27;t start with &quot;X-Forwarded-&quot; then `header.removeprefix(&quot;X-Forwarded-&quot;)` just returns `header`.<p>Nice summary doc, with good examples. You can also visit [this site of mine](<a href="https:&#x2F;&#x2F;ptmcg.pythonanywhere.com&#x2F;python_nutshell_app_a_search" rel="nofollow">https:&#x2F;&#x2F;ptmcg.pythonanywhere.com&#x2F;python_nutshell_app_a_searc...</a>) to search for changes by version (3.7-3.11).
m1r3k10 months ago
Nice overview. Are the performance Advantages mentioned?<p>I didn&#x27;t know about the pyupgrade tool. Very useful.
the__alchemist10 months ago
It was nice to see the &quot;annotations&quot; from 3.7 for helping avoid types with circular imports (for types). I didn&#x27;t know that!<p>I&#x27;d love to see a step further, and avoid the circular import problem entirely. It&#x27;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.
screye10 months ago
This is great. Python is my main language and I learned a lot.<p>The piping and typing changes are so useful ! Bookmarked and I&#x27;ll be coming back to this often.<p>I also caught the sleep token references. Well done .
stenius10 months ago
It&#x27;s incredible to see how much stuff has been added over the last couple of years.<p>I&#x27;ve missed a lot of these that I&#x27;m going to take advantage of!
rubslopes10 months ago
Happy to see that my gripe with f-strings was solved in 3.12. Now you can have quotes inside it!