More Pattern Matching in Python 3.10

It’s much more powerful than 'switch’. I explain with help from Harry Potter and a dead parrot

Alan Jones
Towards Data Science
4 min readJun 14, 2021

--

Photo by Ashkan Forouzani on Unsplash

Python has, at long last, got itself a switch statement. Hooray!

But it’s not your common or garden switch statement as you would find in C or Java — of course not, this is Python. Python 3.10 implements Structural…

--

--