Jim J. Jewett writes:
> What advantage can there be in re-using syntax to mean something
> opposite to what it normally does?
In math, it allows us to write "solve c = f(x) for x". That doesn't
mean "bind c to the value f(x)", it means exactly the opposite. No
problem here, I suppose. So
match p:
case Point(x=a, y=b):
is a way of saying "solve p = Point(x=a, y=b) for a and b".
I understand your distaste for this syntax, but I see no problem
in principle. It's a problem of programmer habits and the evident
inconsistency with forms like "case Point(x=1, y=2)". This is
especially true when a or b is already bound.
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/4G5D3DAI7B77LF3GD2YIOQZUBKYFUD7P/
Code of Conduct: http://python.org/psf/codeofconduct/