[issue24004] avoid explicit generator type check in asyncio

Yury Selivanov report at bugs.python.org
Sat May 30 23:01:56 CEST 2015


Yury Selivanov added the comment:

> Why is the AwaitableABC type check needed, in addition to looking up the relevant method? IIUC, the type check will just do a lookup of the same method if the type hasn't been registered as Awaitable explicitly.

Because __await__ should be defined on the class, not on the method (as for all other magic methods in Python).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24004>
_______________________________________


More information about the Python-bugs-list mailing list