[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

Terry J. Reedy report at bugs.python.org
Fri Jul 16 23:32:43 EDT 2021


Terry J. Reedy <tjreedy at udel.edu> added the comment:

This has been proposed and rejected before.  So I think a pydev discussion and steering council decision would be needed to change.

The current rule in interactive mode is that typing an expression statement echoes the representation of the resulting object.  The proposal is make a rather startling exception to the rule.  The premise is that "the program knows what I meant".

However, that is a too-successful illusion.  'The program' has no idea what one meant other than to print the repr(ob).  Some coredevs had the idea to *guess* what was meant and to give two functions an exceptional representation with a message that would be correct when the guess is correct.

In the other hand, special-casing 'quit\n' and 'exit\n' could be seen as analogous to special-casing '^Z\n'.  And the patch restricts the special casing, without complicated code, to exactly those sequences of keystrokes.

----------
nosy: +terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44603>
_______________________________________


More information about the Python-bugs-list mailing list