This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author FFY00
Recipients DiddiLeija, FFY00, asmeurer, eric.araujo, eryksun, gregory.p.smith, jack__d, p-ganssle, pablogsal, steven.daprano, terry.reedy, theacodes, tlalexander, veky
Date 2021-09-26.15:58:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1632671909.07.0.74816677954.issue44603@roundup.psfhosted.org>
In-reply-to
Content
> Without disagreeing with the general sentiment, just note that you can always do Ctrl-D.

That is true, but there are a couple setups where that doesn't work (those keypresses are consumed by something else). I may not be a good data point though.

> Running the REPL with -S is unusual, so having to use sys.exit() or `raise SystemExit` in that case shouldn't be an issue. 

Yes, it is unusual, however I have found myself asking people to do that when debugging, and I always have to tell people "oh, btw, exit() doesn't work, you have to do ...", which is not nice.

> Even if you are running the REPL without the site module (so that exit 
and quit are not available) the import sys solution is surely the worst 
of the lot, UX-wise.

Two of the solutions you gave (exit and quit) don't work with -S, and Ctrl-D/Ctrl-Z doesn't work in all setups. raise SystemExit is the only real alternative I would consider when I am explaining things to people and want to avoid issues. I standardized in `import sys; sys.exit()` as it's generally easier for people starting out, even though it's 5 more keypresses.

---

Anyway, my point is simply that exiting on python -S does not have a great UX, something that I think should be considered when looking at this proposal. If you think the use-case is relevant enough to not warrant a change like this, that is a valid opinion.

My personal opinion is that we should optimize the UX for the people who are not that knowledgeable, as those are the ones that will have most trouble, while keeping it usable for the rest of users.
I think this change is a net positive considering those parameters, and I think the arguments against this proposal have not properly taken them into account.

FWIW, I consider myself a reasonably knowledgeable user, but still end up making this mistake myself a staggering amount of times.

$ rg 'exit\(\)$' ~/.python_history | wc -l
553
$ rg 'exit$' ~/.python_history | wc -l
132
History
Date User Action Args
2021-09-26 15:58:29FFY00setrecipients: + FFY00, terry.reedy, gregory.p.smith, eric.araujo, steven.daprano, eryksun, veky, p-ganssle, pablogsal, asmeurer, theacodes, jack__d, tlalexander, DiddiLeija
2021-09-26 15:58:29FFY00setmessageid: <1632671909.07.0.74816677954.issue44603@roundup.psfhosted.org>
2021-09-26 15:58:29FFY00linkissue44603 messages
2021-09-26 15:58:28FFY00create