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

Filipe Laíns report at bugs.python.org
Fri Sep 24 18:18:26 EDT 2021


Filipe Laíns <lains at riseup.net> added the comment:

One technical argument on why it would be beneficial to have custom handling like this for exit is that exit is a site-builtin, not a builtin.

$ python -S
Python 3.9.7 (default, Aug 31 2021, 13:28:12)
[GCC 11.1.0] on linux
>>> exit()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'exit' is not defined
>>> import sys
>>> sys.exit()

----------

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


More information about the Python-bugs-list mailing list