Message413704
> 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. |
|
Date |
User |
Action |
Args |
2022-02-22 11:27:13 | asvetlov | set | recipients:
+ asvetlov, yselivanov, skrech |
2022-02-22 11:27:13 | asvetlov | set | messageid: <1645529233.62.0.16015060017.issue46818@roundup.psfhosted.org> |
2022-02-22 11:27:13 | asvetlov | link | issue46818 messages |
2022-02-22 11:27:13 | asvetlov | create | |
|