New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement asyncio repl #81209
Comments
Having an asyncio enabled repr where a top-level "await" possible would be a huge productivity boost. Using asyncio.run() in a REPL is hard, and besides it spawns a new event loop on every call. The big idea: we want users to be able to do this: $ python -m asyncio >>> await asyncio.sleep(10, return='hello')
# after 10 seconds
hello |
The REPL has been merged to 3.8. It's not perfect though -- a ^C might break the asyncio event loop, sometimes ^C stops working altogether. We'll investigate all these issues in follow up PRs. |
"asyncio REPL 3.8.0a4+ (heads/pep587_rename-dirty:ae29b4b186, May 27 2019, 16:10:31)" I suggest "Python asyncio REPL 3.8.0a4+ (...)". I prefer to keep "Python" somewhere. Is "exiting asyncio REPL..." message really helpful? If exit can block, would it possible to only display a message if something "hangs" (takes time)? I would expect something like "Waiting for xxx completion for 1 second...". |
Sure.
NP, I can drop the message. The waiting part isn't necessary, since we don't try to shutdown the loop properly anyways (yet) |
Compared to the vanilla REPL, this doesn’t include readline setup for tab completion and history file. Was it on purpose? |
Not particularly, it was mostly to show it is possible. I'm guessing any improvement to make it more consistent with the normal REPL would be welcome. If you want a fancier repl that also have these features it should work out of the box with IPython. |
This issue is now closed. If someone wants to enhance the asyncio REPL, please open a new issue. |
Is this feature related to pdb? I'm trying to use top-level await in pdb where I set breakpoint(). |
It’s not |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: