Most active commenters
  • riffraff(3)
  • pansa2(3)
  • kqr(3)

←back to thread

122 points phsilva | 16 comments | | HN request time: 1.033s | source | bottom
Show context
thunkingdeep ◴[] No.43110710[source]
This does NOT mean Python will get Tail Call Optimization, as Guido cannot be shown The Light, and has decided.
replies(4): >>43110815 #>>43110832 #>>43111490 #>>43112657 #
ehsankia ◴[] No.43110832[source]
Guido is no longer BDFL though, it's the steering committee that decides.
replies(2): >>43110980 #>>43111674 #
1. riffraff ◴[] No.43111674[source]
the steering committee seems way less conservative than Guido, right?

Looking at python from the outside a lot of changes since GvR stepped down seem like stuff he'd not have been fond of.

replies(2): >>43111761 #>>43111923 #
2. pansa2 ◴[] No.43111761[source]
Any examples? The biggest change since Guido stepped down has been the addition of pattern matching, which he was strongly in favour of.

Moreover, Guido is in favour of ongoing addition of major new features (like pattern matching), worrying that without them Python would become a “legacy language”:

https://discuss.python.org/t/pep-8012-frequently-asked-quest...

replies(2): >>43111975 #>>43112019 #
3. kqr ◴[] No.43111923[source]
I think this is a change longer in the making than that. Back when I started working with Python in the mid--late 2000s, the Zen was holy and it seemed very unlikely to ever see multiple ways to do "one thing".

The Python community has since matured and realised that what they previously thought of as "one thing" were actually multiple different things with small nuances and it makes sense to support several of them for different use cases.

replies(2): >>43112055 #>>43112061 #
4. pinoy420 ◴[] No.43111975[source]
Pattern matching seems like a cool feature that was added just because it was cool. I think the syntax is really odd too - apparently to “be pythonic”. I really see no use for it other than to “look smart”. The fact that case match (switch case is a much better description) is expanded to practically a huge if else is disturbing. Similarly the walrus operator. Other than an answer to “what is a new feature of python that you like” interview trivia question, really, who has actually used it?
replies(3): >>43112467 #>>43113858 #>>43115920 #
5. riffraff ◴[] No.43112019[source]
I was thinking of the walrus operator, various f-string changes, relenting on the "GIL removal must not cost performance" stance (although"covered" by other improvements), things like that.

I don't follow python closely so it may 100% be stuff that GvR endorsed too, or I'm mixing up the timelines. It just feels to me that python is changing much faster than it did in the 2.x days.

replies(2): >>43113462 #>>43115885 #
6. riffraff ◴[] No.43112055[source]
You may be right. I checked and found the introduction of the ternary expression, which I found to be wildly "unpythonic", was back in 2006. Time flies.
7. guappa ◴[] No.43112061[source]
One way to do the things. That's why there's 5000 ways to install a module.
replies(1): >>43112948 #
8. pansa2 ◴[] No.43112467{3}[source]
Yeah, it was added to tick the box for people who ask "does Python have pattern matching?"

If you look at the feature in detail, and especially how it clashes with the rest of the language, it's awful. For example:

https://x.com/brandon_rhodes/status/1360226108399099909

replies(1): >>43113510 #
9. raverbashing ◴[] No.43112948{3}[source]
And 4900 "wrong ways" that will hurt you one way or another
replies(1): >>43113677 #
10. kqr ◴[] No.43113462{3}[source]
This may just be time passing faster now that you're older.
11. kqr ◴[] No.43113510{4}[source]
To be fair, "The Substitution Principle" (more commonly known as "equational reasoning" in this context) has never been valid in any languages that aren't... Haskell, and maybe Ada? Any expression that can trigger side effects is an unsafe substitution. (The reason such substitutions are safe in Haskell and Ada is that those languages prevent expressions from triggering side effects in the first place.)
replies(1): >>43113692 #
12. peterfirefly ◴[] No.43113677{4}[source]
More like 5001.
13. pansa2 ◴[] No.43113692{5}[source]
This isn't about general substitutability though, just about naming constants. If you have `case 404:` and you add a named constant `NOT_FOUND = 404`, you can't change the code to `case NOT_FOUND:` because that completely changes its semantics.

Given that one of the fundamental rules of programming is "don't use magic numbers, prefer named constants", that's terrible language design.

14. Qem ◴[] No.43113858{3}[source]
> Similarly the walrus operator. Other than an answer to “what is a new feature of python that you like” interview trivia question, really, who has actually used it?

At least in my case I use it all the time, to avoid duplicated operations inside comprehensions.

15. dragonwriter ◴[] No.43115885{3}[source]
> python is changing much faster than it did in the 2.x days.

I think part of the reason Guido stepped down was that the BDFL structure created too much load on him dealing with actual and potential change, so its unsurprising that the rate of change increased when the governance structure changed to one that managed change without imposing the same load on a particular individual.

16. dragonwriter ◴[] No.43115920{3}[source]
I don't use pattern matching much, but I use walrus fairly regularly.