To me, however, that would look like a one-element genexp tuple, and would be
too easily confused with something like ((i for i in range(10),)
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@pyt
> > Is this meant to produce a tuple that contains inner tuples, or is it
> the same as tuple(i for i in range(10)) ?
This would be equivalent to tuple(i for i in range(10))
> Is the comma just magic that says "tuple comprehension, not genexp"?
I think that my proposal is consistent with Python's
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)))
___
Python-ideas mailing list -- python-