imaplib: is this really so unwieldy?

Chris Angelico rosuav at gmail.com
Wed May 26 02:35:51 EDT 2021


On Wed, May 26, 2021 at 4:21 PM Grant Edwards <grant.b.edwards at gmail.com> wrote:
>
> On 2021-05-25, Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:
>
> >>Oh ok, it seemed to be fine.  Would it be the right way to do it with
> >>sys.exit()?  Having to import another library just to end a program
> >>might not be ideal.
> >
> >       I've never had to use sys. for exit...
>
> I would have sworn you used to have to import sys to use exit(). Am I
> misremembering?
>
> Apparently exit() and sys.exit() aren't the same, so what is the
> difference between the builtin exit and sys.exit?
>

exit() is designed to be used interactively, so, among other things,
it also has a helpful repr:

>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit

ChrisA


More information about the Python-list mailing list