[New-bugs-announce] [issue32472] Mention of __await__ missing in Coroutine Abstract Methods
Yahya Abou Imran
report at bugs.python.org
Mon Jan 1 01:06:41 EST 2018
New submission from Yahya Abou Imran <yahya-abou-imran at protonmail.com>:
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 <module>
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.
----------
assignee: docs at python
components: Documentation
messages: 309320
nosy: docs at python, yahya-abou-imran
priority: normal
severity: normal
status: open
title: Mention of __await__ missing in Coroutine Abstract Methods
type: enhancement
versions: Python 3.6, Python 3.7
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32472>
_______________________________________
More information about the New-bugs-announce
mailing list