On Fri, Feb 19, 2021 at 1:59 AM Guido van Rossum <gu...@python.org> wrote:
>> 1) What Python construct is to be used at the end of a chain of await
>> calls, if not of a generator-based coroutine decorated with
>> `@types.coroutine` and using a `yield` expression in its body?

> At the end of the chain you can call the __await__() method which gives an 
> iterator, and then you call next() or send() on that iterator. Each 
> next()/send() call then represents an await step, and send() in general is 
> used to provide an awaited result. Eventually this will raise StopIteration 
> with a value indicating the ultimate result (the return value of the 
> top-level async def).

All right, that made sense to me. Thank you so much, Guido.

Thanks for the clarification about `@types.coroutine` as well.

Take care,

Luciano


-- 
Luciano Ramalho
|  Author of Fluent Python (O'Reilly, 2015)
|     http://shop.oreilly.com/product/0636920032519.do
|  Technical Principal at ThoughtWorks
|  Twitter: @ramalhoorg
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/KBWTW6BW2YB7RGYGEBINWJCGZVAUJHCB/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to