Author theacodes
Recipients theacodes
Date 2021-07-12.03:15:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org>
In-reply-to
Content
Presently, when using REPL if a user types simply "exit", they are greeted with a message instructing them to do it "correctly":

>>> exit
Use exit() or Ctrl-Z plus Return to exit

It comes across as a little surprising that (1) the program knows what I meant and (2) the program told me it wouldn't do it unless I request it in a very specific way. This isn't very user-friendly behavior.

Further surprising is the inconsistent behavior of the other built-ins described on interpreter start-up. "copyright" and "credits" work fine without being invoked as a function, whereas "help" and "license" rebuff the user. 

I know there are compelling technical reasons for the current behavior, however, this behavior is a bit off-putting for newcomers. Knowing the technical reasons behind this behavior made me *more* frustrated than less frustrated.

Python is a lovely language and I think we should do what we can to be friendlier to users. I propose a few changes to fix this specific issue:

(1) Include "exit" in the interpreter startup message, making it: Type "help", "copyright", "credits" or "license" for more information, and type "exit" to quit Python.

(2) Make the interactive interpreter exit when the user types simply "exit" or "quit.

To address some possible edge cases an objections:

- if (2) proves too controversial, we should at least do (1) with the slight modification of "exit" to "exit()".
- if there is a concern about accidentally exiting the interpreter, there are several strategies we can use. First, we can only activate this behavior if, and only if, Python is being used as an interactive interpreter. From what I can tell, main() is already distinguishing this case. Second, if absolutely necessary we could ask the user to confirm that they want to exit. For example:

>>> exit
Are you sure you want to exit Python? (yes/no): 

For what it's worth, I am willing to do this work, however, I might need a little guidance to find the right bits.
History
Date User Action Args
2021-07-12 03:15:45theacodessetrecipients: + theacodes
2021-07-12 03:15:45theacodessetmessageid: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org>
2021-07-12 03:15:45theacodeslinkissue44603 messages
2021-07-12 03:15:41theacodescreate