Issue 37028: Implement asyncio repl (original) (raw)

Created on 2019-05-23 22:57 by yselivanov, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 13472 merged yselivanov,2019-05-23 22:58
Messages (8)
msg343334 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2019-05-23 22:57
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
msg343615 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2019-05-27 11:42
New changeset 16cefb0bc7b05c08caf08525398ff178c35dece4 by Yury Selivanov in branch 'master': bpo-37028: asyncio REPL; activated via 'python -m asyncio'. (GH-13472) https://github.com/python/cpython/commit/16cefb0bc7b05c08caf08525398ff178c35dece4
msg343616 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2019-05-27 11:46
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.
msg343630 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-05-27 14:30
"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...".
msg343637 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2019-05-27 15:08
> I suggest "Python asyncio REPL 3.8.0a4+ (...)". I prefer to keep "Python" somewhere. Sure. > 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...". NP, I can drop the message. The waiting part isn't necessary, since we don't try to shutdown the loop properly anyways (yet)
msg370118 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2020-05-27 18:36
Compared to the vanilla REPL, this doesn’t include readline setup for tab completion and history file. Was it on purpose?
msg370132 - (view) Author: Matthias Bussonnier (mbussonn) * Date: 2020-05-27 20:44
> 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.
msg370157 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-28 00:18
This issue is now closed. If someone wants to enhane the asyncio REPL, please open a new issue.
History
Date User Action Args
2022-04-11 14:59:15 admin set github: 81209
2020-05-28 00🔞11 vstinner set resolution: fixedmessages: +
2020-05-27 20:44:41 mbussonn set messages: +
2020-05-27 18:36:31 eric.araujo set nosy: + eric.araujomessages: +
2019-05-27 15:08:30 yselivanov set messages: +
2019-05-27 14:30:07 vstinner set nosy: + vstinnermessages: +
2019-05-27 11:46:05 yselivanov set status: open -> closedmessages: + stage: patch review -> resolved
2019-05-27 11:42:45 yselivanov set messages: +
2019-05-24 01:17:18 xtreak set nosy: + xtreak
2019-05-23 23:05:43 mbussonn set nosy: + mbussonn
2019-05-23 22:58:01 yselivanov set keywords: + patchstage: patch reviewpull_requests: + <pull%5Frequest13446>
2019-05-23 22:57:13 yselivanov create