On Fri, Jun 18, 2021 at 00:43 Serhiy Storchaka <storch...@gmail.com> wrote:

> 18.06.21 00:22, Ben Rudiak-Gould пише:
> > Okay, slightly off-topic, but can we *please* allow
> >
> >     [*chunk for chunk in list_of_lists]
> >
> > some day. I think it was left out because some discussion concluded it
> > would be too confusing, which is ridiculous. I assumed it would work and
> > was confused to find that it didn't. It's blatantly inconsistent.
>
> It was originally proposed in PEP 448 (Additional Unpacking
> Generalizations) but was excluded after discussing.
>
> If we allow
>
>     [*chunk for chunk in list_of_lists]
>
> we should allow also
>
>     [x, y for x in a]
>
> which would be equivalent to
>
>     [a[0], y, a[1], y, a[2], y, ...]


Note the ambiguity around whether the user might have meant

    [x,(y for y in a)]

or

    [(x, y) for y in a]

That’s a good enough reason for me to also disallow *chunks.
-- 
--Guido (mobile)
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/6I63FWKEDQ4RJPUL4CQK22KFCKIIPU5X/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to