An overview of structural pattern matching for Python
An overview of structural pattern matching for Python
Posted May 4, 2022 0:41 UTC (Wed) by tialaramex (subscriber, #21167)Parent article: An overview of structural pattern matching for Python
I wondered why they went with a statement, because expression match feels nicer to me. But PEP 635 says they explicitly considered this question and decided against an expression, and they know much more about Python and about Python programmers than I ever will.
However it is painful to see, also in PEP 635, how problematic new keywords are for Python. If the language wants to go around adding keywords (and it seems it does based on this) it needs to find a way to make that less painful, it got lucky for match but it can't count on always getting lucky.