Python structural pattern matching morphs again
Python structural pattern matching morphs again
Posted Dec 3, 2020 17:29 UTC (Thu) by NYKevin (subscriber, #129325)In reply to: Python structural pattern matching morphs again by mathstuf
Parent article: Python structural pattern matching morphs again
IMHO this whole thing would make a lot more sense if it *just* supported the regular unpacking syntax a la PEP 448, and (maybe) a very conservative extension for matching simple enum constants. Everything else is just going to require too many weird special cases to get right.
Posted Dec 3, 2020 17:55 UTC (Thu)
by ms (subscriber, #41272)
[Link]
Haskell has n+k patterns (albeit behind an option - they're off by default), though one of the args must be a literal constant. But, err, I suspect Prolog and the halting-problem in general is where it would end if you took this to its logical conclusion.
Python structural pattern matching morphs again