[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 09:32:17 EDT 2021


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

IPython and other reprs are an entire abstraction layer on top of Python, which allows them to do a lot of extra things like implement new commands and alters a lot of behaviours, but the CPython REPL is just the interpreter evaluating commands, and this is very coupled with the regular machinery, at to the point that is the tokenizer the one consuming input (lazily!) from standard input.

Unless I am missing anything, the only way to do the desired behaviour is to re-architect part of how interactive mode works or to directly make exit a keyword, which is backwards incompatible. 

I may be missing simpler ways of course, but in general, my opinion is that anything that involves modifying the compiler pipeline to somehow special case this is too much cost for the advantage.

----------

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


More information about the Python-bugs-list mailing list