Oct. 21, 2005
4:58 a.m.
so the new syntax would not be useful, unless it was something that provided access to the index item as a variable, like:
yield foo(i) for i in x
which barely saves you anything (a colon, a newline, and an indent).
Not even that, because you can omit the newline and indent: for i in x: yield foo(i) There's a bigger difference between for i in x: yield i and yield from x Moreover, I can imagine optimization opportunities for "yield from" that would not make sense in the context of comprehensions.