New submission from Yahya Abou Imran <yahya-abou-im...@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@python
components: Documentation
messages: 309320
nosy: docs@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue32472>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to