Question about asyncio doc example

Marko Rauhamaa marko at
Thu Jul 24 09:23:29 CEST 2014

Terry Reedy <tjreedy at>:

> 18.5.3. Tasks and coroutines, seems to be devoid of event wait
> examples. However, there is a 'yield from' network example in 18.5.5
> Streams using socket functions wrapped with coroutines. These should
> definitely be used instead of sleep. In fact, for cross-platform
> network code meant to run on *nix and Windows, they are better than
> the unix oriented select and poll functions.

Asyncio has full support for the callback style as well. What I don't
know is how well the two styles mix. Say, you have a module that
produces callbacks and another one that is based on coroutines. The
coroutines can easily emit callbacks but can callbacks call "yield


More information about the Python-list mailing list