Generator expressions and brackets

Viewed 1894

why are brackets, specifically parentheses, necessary for generator expressions which contain tuples?

Why

((x, y)
 for x in range(10)
 for y in range(20))

instead of

(x, y
 for x in range(10)
 for y in range(20))

SyntaxError: invalid syntax
1 Answers
Related