Pablo Galindo Salgado <pablog...@gmail.com> added the comment:

Thanks, Stargirl for opening this issue and for the thorough description and 
proposals. I am sympathetic with the idea and the general proposal and 
(unsurprisingly) I agree with (1).

For (2) there are some challenges here to consider. The most important one is 
that the mechanism to show those messages is really the repr() of the exit() 
built-in the one showing the message:

>>> x = exit
>>> repr(x)
'Use exit() or Ctrl-D (i.e. EOF) to exit'

There is no other mechanism in the interpreter that triggers anything when the 
user inputs that. The most straightforward way is to raise SystemExit from the 
repr() of the built-in but that has some obvious problems. As printing anything 
where the exit function lives will also raise SystemExit (for instance printing 
the builtins module or objects in the GC). 

For these reasons I propose to go with (1) with the slight modification of 
"exit" to "exit()".

----------
nosy: +pablogsal

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44603>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to