Functional programming with match
Python 3.9 became EOL last week, which means you now have no reason to
not write match statements anymore. While python’s match pattern
matching isn’t as sophisticated or flexible as Elixir’s or Haskell’s,
it’s still a massive improvement over other mainstream
languages.
Recap
This is a recap if you’re not a pythonista; unpacking has existed since the early days. You’ve probably already done things like this
a, b = (1, 2)
print(a + b)
That’s great, and you’ve probably already tried iterable unpacking (PEP 3132)