Issue 32472: Mention of await missing in Coroutine Abstract Methods (original) (raw)

In the collections.abc documentation:

https://docs.python.org/3/library/collections.abc.html

await() doesn't appear in the abstract methods of Coroutine, we see only send() and throw().

But since Coroutine inherit from Awaitable, it's required:

from collections.abc import Coroutine

class MyCoroutine(Coroutine): def send(self, value): raise StopIteration def throw(self, err): raise err

mc = MyCoroutine()

Traceback (most recent call last): File "_tmp.py", line 9, in mc = MyCoroutine() TypeError: Can't instantiate abstract class MyCoroutine with abstract methods await

To be consistent with the rest of the document, this method should appear here to show all the abstract methods, even the inherited ones.