[Python-Dev] Coroutines, generators, function calling (original) (raw)
Andrew Koenig ark at acm.org
Fri Oct 21 06:58:28 CEST 2005
- Previous message: [Python-Dev] Coroutines, generators, function calling
- Next message: [Python-Dev] Migrating to subversion
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Previous message: [Python-Dev] Coroutines, generators, function calling
- Next message: [Python-Dev] Migrating to subversion
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]