On Tue, Jun 23, 2020 at 5:21 PM Ethan Furman <et...@stoneleaf.us> wrote:

> On 06/23/2020 04:26 PM, Guido van Rossum wrote:
> > On Tue, Jun 23, 2020 at 11:41 AM Ethan Furman wrote:
> >
> >     Testing my understanding -- the following snippet from the PEP
> >
> >           match group_shapes():
> >               case [], [point := Point(x, y), *other]:
> >
> >     will succeed if group_shapes() returns two lists, the first one
> being empty and the second one starting with a Point() ?
> >
> >
> > Correct. And it binds four variables: point, x, y, and other.
>
> Okay, so following that example some more:
>
> `other` is all the other items in `group_shape`'s second list
>
> `x` and `y` are the x,y values from the second list's first element (which
> is a Point)
>
> `point` is... the first element of the second list?  Or a __match__ object?
>

The former.

-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________
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/XQ7ULAM3FTEKFWYNITZA4Q46HYYBBNMT/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to