[docs] [issue33459] Define "tuple display" in the docs

R. David Murray report at bugs.python.org
Fri May 11 14:25:27 EDT 2018


R. David Murray <rdmurray at bitdance.com> added the comment:

That's a generator expression, just like [x for x in ramge(3)] is a list comprehension, not a list display.  And yes, in a number of circumstances parenthesis are required to delimit the tuple display and disambiguate the syntax.  That is, it is the 1, 2, 3 that is the tuple display, but sometimes you have to enclose it in parenthesis in order for the parser to recognize it.  Which is why it would be good to give a more thorough explanation of what a tuple display is than the unlabeled one Cheryl pointed out.  I'm not entirely sure what the exact rules are for when you get a syntax error without the parens, myself :)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33459>
_______________________________________


More information about the docs mailing list