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 Ben.Darnell
Recipients Ben.Darnell, gvanrossum, vstinner, yselivanov
Date 2015-06-07.05:06:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1433653613.86.0.241600441921.issue24400@psf.upfronthosting.co.za>
In-reply-to
Content
The new collections.abc.Awaitable ABC relies on __instancecheck__, which makes it incompatible with functools.singledispatch (singledispatch works based on args[0].__class__; any instance-level information is discarded). This surprised me because the first thing I tried to do with Awaitable was add it to my singledispatch-based coroutine compatibility layer.

Ideally coroutine would be an actual subclass of generator, instead of a generator with an extra bit set on the instance that changes how it answers isinstance() checks. That would be a big change, though, so it might be better to just document that Awaitable is kind of unusual (if we weren't already in the beta period I might argue that the ABCs should be removed and we should just use the functions in the inspect module instead).
History
Date User Action Args
2015-06-07 05:06:54Ben.Darnellsetrecipients: + Ben.Darnell, gvanrossum, vstinner, yselivanov
2015-06-07 05:06:53Ben.Darnellsetmessageid: <1433653613.86.0.241600441921.issue24400@psf.upfronthosting.co.za>
2015-06-07 05:06:53Ben.Darnelllinkissue24400 messages
2015-06-07 05:06:52Ben.Darnellcreate