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?