On 06/25/2020 03:00 AM, Greg Ewing 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):
...
I strongly prefer "match expression: case ...:"
--
~Ethan~
_______________________________________________
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/OZ6GSBPCDOJW73DAPXTGVW2L6OQLRIGH/
Code of Conduct: http://python.org/psf/codeofconduct/