Yury Selivanov added the comment:

> OK, but only for await (not for yield from).

Sure, generators will stay untouched (I'll even add a unittest for that, if we 
don't have it).


> It should always be valid to create a new coroutine instance. Perhaps you 
> meant:

Correct, Martin, great that you've noticed that!

I'll duplicate the fixed code:

async def coroutine():
    return 123
coro = coroutine()

# In Python 3.5.1:
print(await coro)   # will print 123
print(await coro)   # prints None
print(await coro)   # prints None

# What we want in Python 3.5.2
print(await coro)   # will print 123
print(await coro)   # raises RuntimeError

----------

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

Reply via email to