Re: PEP 622 version 2 (Structural Pattern Matching)
13 Jul 2020 13 Jul '20
Greg Ewing wrote:
Eric Nieuwland wrote:
... match poly: p0 = Point(x0, y0) p1 = Point(x1, y1) p2 = Point(x2, y2) case Polygon(p0, p1, p2): …
Interesting idea, but what happens if you don't need any setup? Do you have to write
match poly: pass case ...
Yes, that would be the idea.
Unless you would need to setup variables to be bound in the cases, of course. Without that an if … elif … elif … else structure would be equivalent and possibly preferable.
Age (days ago)
Last active (days ago)