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 asvetlov
Recipients asvetlov, skrech, yselivanov
Date 2022-02-22.11:27:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645529233.62.0.16015060017.issue46818@roundup.psfhosted.org>
In-reply-to
Content
> Are you suggesting that I need to just inherit from Awaitable? 

Yes. Awaitable is a very base protocol, Coroutine is an implementation.

`__await__` returns a generator that is used by Python internals as if `yield from awaitable.__await__()` was called.  asyncio never sends data back to the generator but other async frameworks can do it.

`send()`/`close()`/`throw()` coroutine methods are never used now IFAIK.  The current implementation calls these methods at the C level without using Python-exposed names. Performance matters.
These methods can be still used in very rare cases, e.g. when explicit Python `yield from custom_coro.__await__()` is used.
History
Date User Action Args
2022-02-22 11:27:13asvetlovsetrecipients: + asvetlov, yselivanov, skrech
2022-02-22 11:27:13asvetlovsetmessageid: <1645529233.62.0.16015060017.issue46818@roundup.psfhosted.org>
2022-02-22 11:27:13asvetlovlinkissue46818 messages
2022-02-22 11:27:13asvetlovcreate