
Feb. 23, 2015
10:49 a.m.
2015-02-16 13:53 GMT+01:00 Luciano Ramalho <luciano@ramalho.org>:
At a high level, the behavior of send() would be like this:
def send(coroutine, value): if inspect.getgeneratorstate() == 'GEN_CREATED': next(coroutine) coroutine.send(value)
It's strange to have to sometimes run one iterations of the generator, sometimes two iterations. asyncio.Task is a nice wrapper on top of coroutines, you never use coro.send() explicitly. It makes coroutines easier to use. Victor