Yonatan Zunger <zun...@humu.com> added the comment:

Definitely agree about the difference.

I'd say that either SystemExit or EOFError would be a reasonable thing for
the interactive session to do, but the combination of closing stdin and
SystemExit is really weird. Honestly, I would have just expected interact()
to return like an ordinary function when it was done; the logic of "it's
time to close the terminal window" feels like it belongs at a *much* higher
level of the stack.

On Fri, Jul 20, 2018 at 10:16 PM Terry J. Reedy <rep...@bugs.python.org>
wrote:

>
> Terry J. Reedy <tjre...@udel.edu> added the comment:
>
> There is an important difference between a program saying 'I am done
> executing' and a user saying 'I am done with the interactive session'.
> This is especially true in an IDE where 'session' can include many editing
> and shell sessions.
>
> 'Stop executing'  happens when execution reaches the end of the file,
> which causes EOFError upon a read attempt.  It can also be done gracefully
> before the end of input with sys.exit(), which raises SystemExit.
>
> In Interactive Python, 'leave session' can be done with SystemExit or the
> EOF control signal, which appears to raise EOFError.  This suggests that
> quit() and exit(), which were added because newbies did not know the proper
> way to exit, should raise EOFError rather than SystemExit.  The fact that
> 'quit' displays 'Use quit() or Ctrl-Z plus Return to exit' (EOF on Windows)
> suggests the same.  But I need to experiment (another day).
>
> ----------
>
> _______________________________________
> Python tracker <rep...@bugs.python.org>
> <https://bugs.python.org/issue34115>
> _______________________________________
>

----------

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

Reply via email to