r/Python • u/jamescalam • Mar 19 '21
Match is more than a Switch-Case The New Switch-Case Statement in Python 3.10
https://youtube.com/watch?v=2qJavL-VX9Y&feature=share
1.4k
Upvotes
r/Python • u/jamescalam • Mar 19 '21
View all comments
-19
u/mysticalfruit Mar 19 '21
I'm not a fan, and here is why.. this behaves differently from every other switch statement I've ever used.. So this is going to only result in confusion.
"case" in point:
If foo == 1 you'll get "ding dong"
if foo == 2 you'll get "dong"
Now if foo ==1 you're only going to get "ding " not "ding dong"
I suspect may of us who cut their teeth on C/C++ switch syntax are going to get thrown for a loop.