Eryk Sun <eryk...@gmail.com> added the comment:

Running the REPL with -S is unusual, so having to use sys.exit() or `raise 
SystemExit` in that case shouldn't be an issue. 

A user who wants custom behavior for `exit` could override sys.displayhook() in 
the PYTHONSTARTUP file. For example:

    import sys
    import builtins

    def displayhook(obj, prev_displayhook=sys.displayhook):
        exit = getattr(builtins, 'exit', None)
        if obj is exit and callable(exit):
            exit()
        else:
            prev_displayhook(obj)

    sys.displayhook = displayhook

> just note that you can always do Ctrl-D.

For the Windows console, Ctrl-D is not usually supported. It's supported when 
pyreadline is installed. Otherwise one has to type Ctrl-Z and enter. In IDLE 
it's Ctrl-D even in Windows, in which case the `exit` repr is wrong, as 
determined by setquit() in Lib/site.py.

----------
nosy: +eryksun

_______________________________________
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