[$] "Structural pattern matching" for Python, part 1
We last looked at the idea of a Python"match" or "switch" statement back in 2016, but it is something that hasbeen circulating in the Python community both before and since that coverage.In June it was raised again, with a Python Enhancement Proposal (PEP)supporting it: PEP 622("Structural Pattern Matching"). As that title would imply, thematch statement proposed in the PEP is actually a pattern-matchingconstruct with many uses.While it may superficially resemble the C switch statement, aPython match would do far more than simply choose a chunk of codeto execute based on the value of an expression.