This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jack__d
Recipients cameron, docs@python, gvanrossum, iritkatriel, jack__d, lukasz.langa, maggyero, miss-islington, steven.daprano, terry.reedy
Date 2021-08-31.22:31:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> Your docs seem to promote the second, whereas I've usually preferred the
> former. Was this a considered choice on your part?

First and foremost, stupid GitHub is not letting the permalink load for some
reason, but yes; this was discussed in the conversation with @graingert on
June 29th – it was his suggestion. Later, @pradyunsg from PyPa added some
suggestions about how the document described console script entrypoints,
and the documentation around this issue changed a bit again.

As far as my perspective, I also never personally use the sys.exit idiom
myself. After all, an exception is going to cause a non-zero exit code, and a
traceback is always going to have a lot more value than an exit code.

I was, however, surprised to learn how pip treats console script entry points
in the course of working on this document. Specifically, it generates an
executable script that does wrap the function in sys.exit.I definitely think
that the way the document communicates this fact while teaching the idiom is a
good thing, so I think that whole "Idiomatic Usage" section is good.

I do think we can tweak the document slightly to make it less prescriptive,
though, because in reality a lot of people _don't_ use this idiom, so
presenting it as a de-facto standard is misleading. Plus, it's not
Pythonic to dole out prescriptive boilerplate.

I attached a diff that steers in that direction. What do you all think? It is
a pretty slight change, but I think it better strikes a balance.
Date User Action Args
2021-08-31 22:31:41jack__dsetrecipients: + jack__d, gvanrossum, terry.reedy, cameron, steven.daprano, docs@python, lukasz.langa, maggyero, miss-islington, iritkatriel
2021-08-31 22:31:41jack__dsetmessageid: <>
2021-08-31 22:31:41jack__dlinkissue39452 messages
2021-08-31 22:31:41jack__dcreate