
Oct. 18, 2011
8:49 a.m.
On Tue, Oct 18, 2011 at 3:47 PM, Ben Finney <ben+python@benfinney.id.au> wrote:
Nick Coghlan <ncoghlan@gmail.com> writes:
On Tue, Oct 18, 2011 at 2:57 PM, Ben Finney <ben+python@benfinney.id.au> wrote:
More precisely, the parens are not part of the syntax for generator expressions.
Yes they are.
I had the impression that they could appear as a bare expression without parens. But the Python interpreter doesn't support that impression, so I guess I was wrong. Thanks for pointing it out.
You may have been thinking of yield expressions, where the parentheses aren't technically part of the syntax, but are still mandatory in a lot of places to avoid visual ambiguity. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia