[issue22412] Towards an asyncio-enabled command line
Martin Teichmann
report at bugs.python.org
Tue Sep 16 21:51:05 CEST 2014
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 <report at bugs.python.org>
<http://bugs.python.org/issue22412>
_______________________________________
More information about the Python-bugs-list
mailing list