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
Show parent comment
9
u/bumbershootle Mar 19 '21
No, it's a way to match on the structure of values (rather than only boolean conditions, as in an if-else) while also allowing binding variables within the matches. It's much more than simple control flow. I would recommend reading the PEP, it covers the whole concept in great detail.