In this video I show an example of structural pattern matching, a pretty powerful feature that’s part of Python 3.10. There’s a couple of really nice things you can do with this, and although it resembles the traditional switch statement, it goes far beyond what the ‘wicked switch’ can do.

🔖 Chapters:
0:00 Intro
1:02 Explaining the example
1:35 Simple pattern match example
3:37 A more elaborate match example
7:49 Match with conditions
9:30 Match with objects
14:42 Caveats of using structural pattern matching
16:11 Other Python 3.10 features & final thoughts

The code I worked on in this video is available here:… .

✅ Write cleaner code with Sourcery:…



A Closer Look At Structural Pattern Matching // New In Python 3.10!
8.60 GEEK