Message252287
> @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()` |
|
Date |
User |
Action |
Args |
2015-10-04 20:34:29 | yselivanov | set | recipients:
+ yselivanov, gvanrossum, vstinner, r.david.murray, Yury.Selivanov, python-dev, vxgmichel |
2015-10-04 20:34:29 | yselivanov | set | messageid: <1443990869.66.0.656928917577.issue25304@psf.upfronthosting.co.za> |
2015-10-04 20:34:29 | yselivanov | link | issue25304 messages |
2015-10-04 20:34:29 | yselivanov | create | |
|