Nathaniel Smith <n...@pobox.com> added the comment:

Ah-hah, I get what's going on.

@asyncio.coroutine has always been buggy: when debug mode is turned on, then it 
fails to set CO_ITERABLE_COROUTINE.

However, when debug mode is turned on, then traditionally native coroutines got 
wrapped into CoroWrapper objects. We've always been lazy and reused the same 
CoroWrapper type for both native coroutines and old-style @asyncio.coroutine 
coroutines, so CoroWrapper has both coroutine and generator attributes.

This means that until my patch, in debug mode, native coroutines were *getting 
turned back into generators*. So this hid the bug in @asyncio.coroutine, 
because it doesn't matter if you can't call native coroutines if you've just 
turned them into generators.

The fix is trivial, we just need to always use @types.coroutine in 
@asyncio.coroutine, I'll put up a PR momentarily.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32636>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to