On Thu, Jun 25, 2020 at 3:17 AM Greg Ewing <greg.ew...@canterbury.ac.nz> wrote:
> On 25/06/20 7:50 pm, Anders Munch wrote: > > Pascal is a precedent for this placement of 'case', > > Yes, but it doesn't use it with "match". In fact it doesn't have > any keyword in front of the values to be matched; it goes like > > case n of > 1: ...; > 2: ...; > 3: ...; > end > > If we did that in Python it would look like this: > > case shape: > Point(x, y): > ... > Line(x1, y1, x2, y2): > ... > Circle(cx, cy, r): > ... > > What think folks of this? > It feels like it would be the only bit of syntax in Python that requires a `:` and yet has no keyword to go with it for clarification of what the block is meant for. That makes me not like this.
_______________________________________________ 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/BUGY5NJEZR5BWGHE2LXNB4UJ5C2TJY5O/ Code of Conduct: http://python.org/psf/codeofconduct/