
Oct. 17, 2003
6:09 p.m.
Guido van Rossum wrote:
but perhaps we can make this work:
sum(x for x in S)
[Shane Holloway]
Being able to use generator compressions as an expression would be useful. In that case, I assume the following would be possible as well:
mygenerator = x for x in S
for y in x for x in S: print y
return x for x in S
You'd probably have to add extra parentheses around (x for x in S) to help the poor parser (and the human reader). --Guido van Rossum (home page: http://www.python.org/~guido/)