The meaning of `this`
The meaning of `this`
Partially unrelated to the meme, but I find it almost malicious how some python keywords are named differently from the nearly universal counterpart of other languagues.
This/self, continue/pass, except/catch and they couldn’t find a different word for switch so they just didn’t implement it.
It’s as if the original designers purposefully wanted to be different for the sake of it.
Python does have a switch statement now, actually. And yes, they went out of their way to call it something different - match.
match isn’t just equivalent to switch though, so in this case it actually makes sense to call it something different.
This is very true. Match statements are much more powerful that switch statements in any other language.
For instance: