18.06.21 17:38, Guido van Rossum пише:
> Note the ambiguity around whether the user might have meant
>
> [x,(y for y in a)]
>
> or
>
> [(x, y) for y in a]
Yes, I think that it could be interpreted in one of the following ways:
[x, (y for y in a)]
[x, *(y for y in a)]
[(x, y) for y in a]
[*(x, y) for y in a] # if allow [*chunk for ...]
Any interpretation can be well-justified and formally non-ambiguous once
we choose the one to be allowed. But it will still *look* ambiguous, so
it is better to avoid such syntax in Python which is famous for its
clear syntax.
I withed that I could write just [*chunk for ...] several times per
year, but I understand that there were reasons to not allow it.
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/G2IQF7OYBCCRC4OKDK3DR4ZM4CE3YTRV/
Code of Conduct: http://python.org/psf/codeofconduct/