Message246137
Guido, Ben, Stefan, Nick,
I want to re-open this issue. I'm still not satisfied with the current state of things, mainly with the __instancecheck__ hack for Awaitable & Coroutine ABCs (as Ben initially suggested).
I think we should remove the __instancecheck__ from the ABCs, and resurrect inspect.isawaitable() function:
1. abc.Coroutine and abc.Awaitable will guarantee that objects that implement them have '__await__' and it's safe to access it (that means that they will fail for generator-based coroutines).
2. inspect.isgenerator() can be used along with inspect.isawaitable() to detect generator-based coroutines (generators with CO_ITERABLE_COROUTINE flag). |
|
| Date |
User |
Action |
Args |
| 2015-07-03 05:28:05 | yselivanov | set | recipients:
+ yselivanov, gvanrossum, ncoghlan, scoder, vstinner, r.david.murray, asvetlov, Yury.Selivanov, python-dev, Ben.Darnell, martin.panter |
| 2015-07-03 05:28:05 | yselivanov | set | messageid: <[email protected]> |
| 2015-07-03 05:28:05 | yselivanov | link | issue24400 messages |
| 2015-07-03 05:28:05 | yselivanov | create | |
|