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. _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/CMDHKH3YPLIQ4WGI4MEL2BQKKVU6DGDE/ Code of Conduct: http://python.org/psf/codeofconduct/