[issue24004] avoid explicit generator type check in asyncio

Stefan Behnel report at bugs.python.org
Sat May 30 19:56:27 CEST 2015


Stefan Behnel added the comment:

Cython functions that return a generator aren't special in any way, so it's actually correct that isgeneratorfunction() always returns False. I mean, I could set the CO_COROUTINE flag on the code object that we fake, but that wouldn't help much as Cython's functions are not Python functions, so isfunction() will also return False for them and no-one would look at the flag in the first place. And finally, a Cython generator is not a Python generator (with byte code position etc.), so isgenerator() also correctly returns False.

At least iscoroutine() and iswaitable() will return True for Cython Coroutines now.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24004>
_______________________________________


More information about the Python-bugs-list mailing list