[docs] [issue24439] Feedback for awaitable coroutine documentation

Yury Selivanov report at bugs.python.org
Mon Jun 22 20:34:53 CEST 2015

Yury Selivanov added the comment:

Hi Martin,

I've left you some feedback in the code review.

> * “async def” routines are allowed in addition to generators in asyncio (e.g. in Task constructor)

Right. I think we need to add some code samples too.

> * Other awaitables are also accepted as asyncio coroutines

Depending on where, I guess. asyncio.Task should only accept when asyncio.iscoroutine is true -- abc.Coroutine, types.GeneratorType.

> * List of “yield from” actions could be augmented with “await”, “async for”, etc

Not sure what you mean here.

> * The coroutines provided by asyncio are both iterable and awaitable, so they may be used with both “yield from” and “await”


We also need to make sure that it's documented that in order to have "yield from native_coro()", you have to decorate the gen function with 'asyncio.coroutine'.

And we should mention that if you're targeting Python 3.5+ you should use the new syntax.

> * Change references of asyncio.async() to ensure_future()

This is already done ;)


nosy: +asvetlov, gvanrossum, haypo

Python tracker <report at bugs.python.org>

More information about the docs mailing list