
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2016-07-19 12:55 bysteven.daprano, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| code.patch | steven.daprano,2016-07-19 13:36 | review | ||
| Messages (12) | |||
|---|---|---|---|
| msg270822 -(view) | Author: Steven D'Aprano (steven.daprano)*![]() | Date: 2016-07-19 12:55 | |
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. | |||
| msg270825 -(view) | Author: Steven D'Aprano (steven.daprano)*![]() | Date: 2016-07-19 13:36 | |
This time, with a patch that includes updated tests. | |||
| msg272678 -(view) | Author: Brett Cannon (brett.cannon)*![]() | Date: 2016-08-14 16:10 | |
LGTM | |||
| msg272680 -(view) | Author: Paul Moore (paul.moore)*![]() | Date: 2016-08-14 16:28 | |
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. | |||
| msg272684 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-08-14 18:17 | |
New changeset9410dc027505 by Steven D'Aprano in branch 'default':Issue27573 code.interact prints a message when exiting.https://hg.python.org/cpython/rev/9410dc027505 | |||
| msg272687 -(view) | Author: Ned Deily (ned.deily)*![]() | Date: 2016-08-14 18:46 | |
Steven, don't forget to updateMisc/NEWS and to close this issue on the bug tracker. Thanks! | |||
| msg273016 -(view) | Author: Armin Rigo (arigo)*![]() | Date: 2016-08-18 08:19 | |
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). | |||
| msg273019 -(view) | Author: Steven D'Aprano (steven.daprano)*![]() | Date: 2016-08-18 10:59 | |
On Thu, Aug 18, 2016 at 08:19:25AM +0000, Armin Rigo wrote:> Can we make the exit message optional?Sure. What API do you prefer? I'm thinking to just give interact() an optional "exitmsg" argument, similar to banner: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 this coming weekend. | |||
| msg273021 -(view) | Author: Armin Rigo (arigo)*![]() | Date: 2016-08-18 12:13 | |
I'm fine with `exitmsg`. I guess it would be a flag (not `None` as you wrote), defaulting to `True`? | |||
| msg273022 -(view) | Author: Armin Rigo (arigo)*![]() | Date: 2016-08-18 12:26 | |
...ah, upon closer inspection, we don't use the ``interact()`` method anyway. We already copied and tweaked this method: one problem was that it gives no way to run without printing at least one '\n' of banner at the beginning. Then a more important tweak was made when we added multiline input with `pyrepl` by default. So feel free to ignore my request.(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...) | |||
| msg273459 -(view) | Author: Steven D'Aprano (steven.daprano)*![]() | Date: 2016-08-23 14:49 | |
On Thu, Aug 18, 2016 at 12:26:56PM +0000, Armin Rigo wrote:> ...ah, upon closer inspection, we don't use the ``interact()`` method > anyway. We already copied and tweaked this method: one problem was > that it gives no way to run without printing at least one '\n' of > banner at the beginning. Then a more important tweak was made when we > added multiline input with `pyrepl` by default. So feel free to > ignore my request.I think making the exit message configurable is a good idea even if PyPy doesn't do it, and it should be an easy few lines, so I'll do it even if you don't need it for PyPy. | |||
| msg273485 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-08-23 16:41 | |
New changesetc4863530cfd6 by Steven D'Aprano in branch 'default':Issue#27573 make the exit message configurable.https://hg.python.org/cpython/rev/c4863530cfd6 | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:34 | admin | set | github: 71760 |
| 2016-08-23 16:41:03 | python-dev | set | messages: +msg273485 |
| 2016-08-23 14:49:59 | steven.daprano | set | messages: +msg273459 |
| 2016-08-18 12:26:56 | arigo | set | messages: +msg273022 |
| 2016-08-18 12:13:56 | arigo | set | messages: +msg273021 |
| 2016-08-18 10:59:12 | steven.daprano | set | messages: +msg273019 |
| 2016-08-18 08:19:25 | arigo | set | nosy: +arigo messages: +msg273016 |
| 2016-08-15 01:20:09 | steven.daprano | set | status: open -> closed resolution: fixed stage: resolved |
| 2016-08-14 18:46:55 | ned.deily | set | nosy: +ned.deily messages: +msg272687 |
| 2016-08-14 18:17:47 | python-dev | set | nosy: +python-dev messages: +msg272684 |
| 2016-08-14 16:28:23 | paul.moore | set | nosy: +paul.moore messages: +msg272680 |
| 2016-08-14 16:10:01 | brett.cannon | set | assignee:steven.daprano messages: +msg272678 nosy: +brett.cannon |
| 2016-07-19 13:36:23 | steven.daprano | set | files: +code.patch messages: +msg270825 |
| 2016-07-19 13:34:59 | steven.daprano | set | files: -code.patch |
| 2016-07-19 12:55:40 | steven.daprano | create | |