On Mon, 18 Nov 2019 at 03:57, Daniel Zeng <daniel.z...@gmail.com> wrote:
>
> Syntax for tuple comprehension, something like:
> (i, for i in range(10))
>
> This shouldn't result in ambiguity, since generators need to be in 
> parentheses anyway:
> (i, for i in range(10)) vs (1, (i for i in range(10)))

I'm going to ignore the discussion on where precisely the commas
should go in this (it's very relevant, but different from the point I
want to make) and ask, is this really something that happens often
enough to need dedicated syntax, rather than simply using tuple(i for
i in range(10))? I don't think orthogonality/consistency arguments
really work here (as they are the ones that get bogged down in
questions about where the commas go) so I'd want to see some evidence
that this solved a significant problem in real-world code.

Paul
_______________________________________________
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/S72R3G67UD57PCLMGDCTKVEHJT4UYVSI/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to