
If it's for the REPL, it's already there, you simply need to start the async REPL. $ python -m asyncio asyncio REPL 3.8.5 | packaged by conda-forge | (default, Sep 16 2020, 17:43:11) [Clang 10.0.1 ] on darwin Use "await" directly instead of "asyncio.run()". Type "help", "copyright", "credits" or "license" for more information.
import asyncio await asyncio.sleep(1)
compile and exec have a mode to allow top-level async as well if you want it programmatically, then you can `await` your code object. -- Ma On Sat, 6 Feb 2021 at 07:43, Guido van Rossum <guido@python.org> wrote:
The proposal is to add a default event loop that is always active.
On Sat, Feb 6, 2021 at 06:41 <redradist@gmail.com> wrote:
I mean to be able to do something like this: ```python import asyncio
await asyncio.sleep(1); ```
-- --Guido (mobile) _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/ATXEJR... Code of Conduct: http://python.org/psf/codeofconduct/