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?

--
~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/YO3TFM3Z65G6KL47JS457ZOCB54DWUEJ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to