Yury Selivanov added the comment:

> @yury: but where would you have gotten the awaitable in the first place? It's 
> easy to see how to get a coroutine -- just define it (with either @coroutine 
> or async def) and call it -- and I think that's the only use case that 
> matters here.

Just a few days ago Andrew Svetlov raised a question on github -- how could he 
refactor `aiohttp.get()` coroutine to be a coroutine (compatible with coroutine 
ABC) *and* an async context manager.  With my recent commit, `ensure_future()` 
now accepts not just coroutines or futures, but all objects with `__await__`.

So if you have a library with an API exposed through coroutines, it would be 
great if you have some freedom do refactor it and keep it compatible with 
asyncio functions such as `run_coroutine_threadsafe()`

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25304>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to