This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yselivanov
Recipients Ben.Darnell, Yury.Selivanov, asvetlov, gvanrossum, martin.panter, ncoghlan, python-dev, r.david.murray, scoder, vstinner, yselivanov
Date 2015-07-03.05:28:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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:05yselivanovsetrecipients: + yselivanov, gvanrossum, ncoghlan, scoder, vstinner, r.david.murray, asvetlov, Yury.Selivanov, python-dev, Ben.Darnell, martin.panter
2015-07-03 05:28:05yselivanovsetmessageid: <>
2015-07-03 05:28:05yselivanovlinkissue24400 messages
2015-07-03 05:28:05yselivanovcreate