"Structural pattern matching" for Python, part 2
"Structural pattern matching" for Python, part 2
Posted Sep 11, 2020 13:27 UTC (Fri) by mathstuf (subscriber, #69389)In reply to: "Structural pattern matching" for Python, part 2 by milesrout
Parent article: "Structural pattern matching" for Python, part 2
> It's not supported by the language *for good reason*.
This feels like one of those "cannot derive ought from is" statements. Is there any indication that something better than `isinstance` if-trees was explicitly rejected earlier in the language's design process? I'd expect the previous approach was "just treat it like a duck and if it quacks well enough, what do you care?", but with types now becoming more and more of a thing in general (even in Python), this seems like a natural thing to be considering around this time (to me at least).
