3 ms·
Nothing is looking for exit. The REPL is calling repr(result) to show the result of the expression to the user. repr(exit) is the string "Use exit() or Ctrl-D (
by slooonz 3y ago
Nothing is looking for exit. The REPL is calling repr(result) to show the result of the expression to the user. repr(exit) is the string "Use exit() or Ctrl-D (i.e. EOF) to exit". You _really_ don’t want repr(builtin) to have a side-effect like terminating the program.
Stop being toxic and patronizing towards open-source developers out of ignorance.
- gizmo 3y agoipython has specifically implemented an Autocall that allows you to exit by typing exit, quit, exit() or quit(). https://ipython.readthedocs.io/en/stable/api/generated/IPython.core.autocall.html#IPython.core.autocall.ExitAutocall https://ipython.readthedocs.io/en/stable/api/generated/IPyth... And repr(exit) also works fine: > In [1]: repr(exit) > Out[1]: '<IPython.core.autocall.ExitAutocall object at 0x102772770>' Maybe don't be so eager to accuse people of ignorance and toxicity.