[Python-ideas] Tuple Comprehensions

Nick Coghlan ncoghlan at gmail.com
Tue Oct 18 08:49:15 CEST 2011


On Tue, Oct 18, 2011 at 3:47 PM, Ben Finney <ben+python at benfinney.id.au> wrote:
> Nick Coghlan <ncoghlan at gmail.com> writes:
>
>> On Tue, Oct 18, 2011 at 2:57 PM, Ben Finney <ben+python at 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 at gmail.com   |   Brisbane, Australia



More information about the Python-ideas mailing list