This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yselivanov
Recipients Yury.Selivanov, gvanrossum, python-dev, r.david.murray, vstinner, vxgmichel, yselivanov
Date 2015-10-04.20:34:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1443990869.66.0.656928917577.issue25304@psf.upfronthosting.co.za>
In-reply-to
Content
> @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()`
History
Date User Action Args
2015-10-04 20:34:29yselivanovsetrecipients: + yselivanov, gvanrossum, vstinner, r.david.murray, Yury.Selivanov, python-dev, vxgmichel
2015-10-04 20:34:29yselivanovsetmessageid: <1443990869.66.0.656928917577.issue25304@psf.upfronthosting.co.za>
2015-10-04 20:34:29yselivanovlinkissue25304 messages
2015-10-04 20:34:29yselivanovcreate