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

Pablo Galindo Salgado report at bugs.python.org
Mon Jul 12 10:39:05 EDT 2021


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

> I do want to be cautious of saying that we can't do it because of the way the REPL is currently implemented- which appears to be an implementation driven by convenience more than necessity.

Apologies if I have not been clear on this. Is not that we can't do it, is just the balance between complexity and the benefits of the change.

> I also find pushing against special-case behavior in the REPL strange. The REPL already has special-case behavior: printing the header, the __interactivehook__ that configures readline, heck, the `>>>` are unique the REPL and plainly copy-pasting a REPL session into a file won't work.

But that is just printing, not semantic behaviour. What we are discussing here is to give a different semantic behaviour to exit NAME only in interactive mode. This is fundamentally different that just printing or make the parser show ">>>" every time it asks for a new line, as those are not changing the *meaning* of Python code.

----------

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


More information about the Python-bugs-list mailing list