-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
code.interact() should print an exit message #71760
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
Comments
Way too often I've lost track of whether I'm in the code.interact() REPL or the original REPL, or hit Ctrl-D once too often, and accidentally quit the real REPL. It is easy to lose track, since the real and imitation REPL both use the same prompts. It would be useful if code.interact() and the InteractiveConsole printed a message when they exited. |
This time, with a patch that includes updated tests. |
LGTM |
LGTM. Maybe worth a documentation note - "Changed in 3.6 - added an exit message"? But I'm OK with it as is if you don't think that's worth it. |
New changeset 9410dc027505 by Steven D'Aprano in branch 'default': |
Steven, don't forget to update Misc/NEWS and to close this issue on the bug tracker. Thanks! |
Can we make the exit message optional? Otherwise PyPy will need to patch code.py to add the option to not display this message when used as the normal REPL (yes, PyPy uses the plain code.py as its built-in REPL). |
On Thu, Aug 18, 2016 at 08:19:25AM +0000, Armin Rigo wrote:
Sure. What API do you prefer? I'm thinking to just give interact() an def interact(banner=None, readfunc=None, local=None, exitmsg=None): and similar for InteractiveConsole.interact. If you're happy with that, I should be able to get the change done over |
I'm fine with |
...ah, upon closer inspection, we don't use the (Multiline input is great, btw, if you use the interactive Python a lot. That would be a completely different patch---if I thought that there's a good chance of it not languishing forever on this bug tracker, which I honestly don't think is the case...) |
On Thu, Aug 18, 2016 at 12:26:56PM +0000, Armin Rigo wrote:
I think making the exit message configurable is a good idea even if PyPy |
New changeset c4863530cfd6 by Steven D'Aprano in branch 'default': |
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: