On Mon, 13 Jul 2020 at 09:30, Federico Salerno <salerno...@gmail.com> wrote:

> On 13/07/2020 00:20, Guido van Rossum wrote:
>
> The need for a wildcard pattern has already been explained -- we really
> want to disallow `Point(x, y, y)` but we really need to allow `Point(z, _,
> _)`. Generating code to assign the value to `_` seems odd given the clear
> intent to *ignore* the value.
>
> Would it be impossible for the parser to interpret Point(x, y, y) as "the
> second and third arguments of Point must have the same value in order to
> match. Bind that value to y"? Since the value has to be the same, it
> doesn't matter whether y binds to the first or the second (or the nth)
> instance of it.
>
No, that would not be impossible but fraught with problems. This is
discussed in the PEP:
https://www.python.org/dev/peps/pep-0622/#algebraic-matching-of-repeated-names
_______________________________________________
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/RQYFJ2TY3FLYLD233AH7VSQDOJRE7UQS/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to