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, scoder, vstinner, yselivanov
Date 2015-06-20.08:17:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1434788260.5.0.959920692201.issue24400@psf.upfronthosting.co.za>
In-reply-to
Content
OK, let's go with cr_* prefix for coroutine type's slots.

Nick, there is one more thing I'd be glad to receive your input on.  Currently, inspect.iscoroutine(o) uses isinstance(o, abc.Coroutine) to do the check.  Ben and Stefan reasonably ask to refactor isgenerator() to use abc.Generator.

However, after giving this some thought, I think that inspect.iscoroutine() should actually use isinstance(types.CoroutineType).  Lots of existing code assumes, that if isgenerator() returns True, then the object has gi_code etc, so the function returns True when the passed object is a pure Python generator.  Same logic should work for iscoroutine(), right?

isawaitable(), however, should continue using abc.Awaitable, since it only checks for __await__ presence on the type (or should we just drop it?)
History
Date User Action Args
2015-06-20 08:17:40yselivanovsetrecipients: + yselivanov, gvanrossum, ncoghlan, scoder, vstinner, asvetlov, Yury.Selivanov, Ben.Darnell, martin.panter
2015-06-20 08:17:40yselivanovsetmessageid: <1434788260.5.0.959920692201.issue24400@psf.upfronthosting.co.za>
2015-06-20 08:17:40yselivanovlinkissue24400 messages
2015-06-20 08:17:39yselivanovcreate