As of March 2021 structural pattern matching is not only officially accepted but also available in the latest alpha and development version of Python 3.10. I wrote an article "Get started with Pattern Matching in Python, today!" last week detailing how this could be achieved but I'll do a short recap here.
Install 3.10-dev/a6 via pyenv
First make sure you've got pyenv installed and set up. At this point simply do
pyenv install 3.10-dev
You can now activate the beta locally and run the interpreter.
pyenv local 3.10-dev
python
Python 3.10.0a6+ (heads/master:87f649a409, Mar 11 2021, 16:29:20) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Run via docker container
You can also use docker if you don't care about having 3.10 running directly in your local system. The new alpha 6 is already up and a 3.10.0a6 interpreter can easily be launched in a container like this.
docker run -it python:3.10.0a6-buster
There you have it, two different ways to use/test the new structural pattern matching in python.
Note: This is still an early release, the completed version will be available in October, so don't build your production stack on this feature just yet. But if you want to experiment with future concepts, you can do so today.