← Back to context

Comment by pansa2

6 months ago

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...

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.

  • > 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.

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?

  • > 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.

  • 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

    • 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.)

      1 reply →