Martin Teichmann added the comment:

And as a last comment, just for completeness, a complete 
async console. With it you can do cool things like

>>> from asyncio import sleep, async
>>> def f():
...    yield from sleep(3)
...    print("done")
>>> yield from f()
[after 3 seconds]
done
>>> async(f())
>>> [wait another 3 seconds] done

Just see how async puts something in the background, while
yield from keeps it up, and how the event loop runs even
while we're doing nothing!

Let's hope other projects out there are more open to making 
their event loops asyncio-compatible than CPython is -
otherwise asyncio will soon cease to exist.

----------
Added file: http://bugs.python.org/file36633/cl.py

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

Reply via email to