[Python-ideas] With clauses for generator expressions

Serhiy Storchaka storchaka at gmail.com
Thu Nov 15 19:15:30 CET 2012


On 15.11.12 17:32, Andrew Barnert wrote:
> If you can only have one with per for, this doesn't have a direct translation.

Even with one "with" per "for" an ambiguity is possible for some 
options. with/for/if/yield, for/with/if/yield, for/if/with/yield, 
for/if/with/if/yield,... should have different transcription.

> The fact that option 3 can obviously do something which seems impossible in
> option 2, and which I can't work out in a few seconds off the top of my head
> with option 1, may be a more compelling argument than the fact that option 1
> instinctively looked cleaner to me (and the one other person who commented on
> the three choices).

Yes, that is what I wanted to show. Even if for you, the author of the 
proposal, the most consistent option is the least obvious, then for 
others it will always lead to confusion.




More information about the Python-ideas mailing list