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:
I don't use pattern matching much, but I use walrus fairly regularly.