On Mon, 18 Nov 2019 at 03:57, Daniel Zeng <[email protected]> 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 -- [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/S72R3G67UD57PCLMGDCTKVEHJT4UYVSI/ Code of Conduct: http://python.org/psf/codeofconduct/
