Why is the argparse module so inflexible?

Isaac To isaac.to at gmail.com
Sat Jun 29 00:37:33 EDT 2013


On Sat, Jun 29, 2013 at 9:36 AM, Ethan Furman <ethan at stoneleaf.us> wrote:

> On 06/27/2013 03:49 PM, Steven D'Aprano wrote:
>
>>
>> Libraries should not call sys.exit, or raise SystemExit. Whether to quit
>> or not is not the library's decision to make, that decision belongs to
>> the application layer. Yes, the application could always catch
>> SystemExit, but it shouldn't have to.
>>
>
> So a library that is explicitly designed to make command-line scripts
> easier and friendlier should quit with a traceback?
>
> Really?
>

Perhaps put the functionality "handling of the exception of library to
sys.exit with a message" into a method so that the user can override it
(e.g., so that it just throw the same exception to the caller of the
library)?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130629/69b8ef90/attachment.html>


More information about the Python-list mailing list