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 scoder
Recipients gvanrossum, scoder, vstinner, yselivanov
Date 2015-04-20.06:04:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1429509895.92.0.243508770314.issue24004@psf.upfronthosting.co.za>
In-reply-to
Content
I was (silently) hoping that this patching would eventually not be necessary anymore because the one place (currently inspect.isgenerator()) would be adapted to check for the generator protocol rather than the generator type. But that was going to go into a separate ticket. :)

I'm not sure inspect.isgenerator() is the right place, though, as the module tends to deal with types, not protocols. I think the right fix overall would be a Generator ABC class that defines the protocol.

What Cython does now in order to make asyncio work with Cython compiled generators is this:

https://github.com/cython/cython/blob/4af42443bd37f6207143f8870904f780a65bb3e3/Cython/Utility/Generator.c#L824

https://github.com/cython/cython/blob/4af42443bd37f6207143f8870904f780a65bb3e3/Cython/Utility/Generator.c#L906

Aweful, but currently required due to the type check, which prevents objects that implement the generator protocol from being handled correctly by asyncio.
History
Date User Action Args
2015-04-20 06:04:55scodersetrecipients: + scoder, gvanrossum, vstinner, yselivanov
2015-04-20 06:04:55scodersetmessageid: <1429509895.92.0.243508770314.issue24004@psf.upfronthosting.co.za>
2015-04-20 06:04:55scoderlinkissue24004 messages
2015-04-20 06:04:55scodercreate