[Python-Dev] async/await in Python; v2

Paul Sokolovsky pmiscml at gmail.com
Thu Apr 23 12:13:57 CEST 2015


Hello,

On Thu, 23 Apr 2015 20:39:51 +1200
Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:

> Paul Sokolovsky wrote:
> > And having both asymmetric and symmetric
> > would quite confusing, especially that symmetric are more powerful
> > and asymmetric can be easily implemented in terms of symmetric using
> > continuation-passing style.
> 
> You can also use a trampoline of some kind to
> relay values back and forth between generators,
> to get something symmetric.

Yes, that's of course how coroutine frameworks were done long before
"yield from" appeared and how Trollius works now. But this just proves
point given to the original subtopic starter - that Python already has
powerful enough machinery to achieve functionality needed for "yield to
asyncio main loop", and adding something specifically for that will
only make situation more complicated (because what is asyncio main
loop? Just a random user-level function/coroutine, if you need to
support yielding "directly" to it, you need to supporting yielding
directly to an arbitrary coroutine).

> 
> -- 
> Greg

-- 
Best regards,
 Paul                          mailto:pmiscml at gmail.com


More information about the Python-Dev mailing list