Generators versus Coroutines
npat at efault.net
Mon Aug 16 21:19:44 CEST 2004
On 2004-08-15, Michael Sparks <zathras at thwackety.com> wrote:
>> For me it would be *tremendously* usefull if one could yield across
>> multiple levels of function calls. If this was supported, then most
>> uses of O/S treads could be replaced by generators.
I didn't knew about Stackless or Greenlets. I will take a look at
> Indeed using the new decorator syntax you could probably simplify this to:
> def foobar(i): Yield(i)
> def g(n):
> for i in range(n):
Another excellent use for decorators!
More information about the Python-list