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-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to