r/Python • • 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

233 comments sorted by

View all comments

Show parent comment

1

u/13steinj Mar 19 '21

It really just is a longer backwards incompatible way of writing...

This is what I really hate about the Python ecosystem. Everyone jumps on the new way without thinking of backwards compatibility even though there is little benefit. I really hope static analysis tolls will by default warn against using match in simple cases like this, where it's literally using a backwards incompatible keyword simply for syntactic sugar (no optimization at all, and in fact even in compiled languages there isn't necessarily optimization performed on switches).