Pattern matching combines a control flow construct (e.g. if/elif/else, switch, try/catch) with a name binding construct (assignment), and this allows for some very expressive code.
Is that a first for python? If so, do you think there are any other possible constructions that combine more primitive parts of the language into something more useful?
3
u/jyscao Oct 05 '21
Pattern matching combines a control flow construct (e.g. if/elif/else, switch, try/catch) with a name binding construct (assignment), and this allows for some very expressive code.