"Structural pattern matching" for Python, part 2
"Structural pattern matching" for Python, part 2
Posted Sep 16, 2020 15:59 UTC (Wed) by HelloWorld (guest, #56129)In reply to: "Structural pattern matching" for Python, part 2 by udifuchs
Parent article: "Structural pattern matching" for Python, part 2
> case Point2D(x, y):
>
> It looks like the class is being initiated.
>
> It looks like the class is being initiated.
No, it doesn't, because there is a case keyword right before it, it's pretty much impossible to miss. If the reader doesn't know what that means and starts making wild guesses, the problem isn't with the language but with the reader.
