Message 322123 - Python tracker

Message322123

Author Yonatan Zunger
Recipients Yonatan Zunger, docs@python, terry.reedy
Date 2018-07-21.21:14:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAFk=nbScD1NfeWvGRMak3BWu7x0EzzaPuFXpYAXvPsXujKjGNA@mail.gmail.com>
In-reply-to <1532150181.27.0.56676864532.issue34115@psf.upfronthosting.co.za>
Content
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 <report@bugs.python.org>
wrote:

>
> Terry J. Reedy <tjreedy@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 <report@bugs.python.org>
> <https://bugs.python.org/issue34115>
> _______________________________________
>
History
Date User Action Args
2018-07-21 21:14:35Yonatan Zungersetrecipients: + Yonatan Zunger, terry.reedy, docs@python
2018-07-21 21:14:35Yonatan Zungerlinkissue34115 messages
2018-07-21 21:14:34Yonatan Zungercreate