Why is the argparse module so inflexible?

Modulok modulok at gmail.com
Fri Jun 28 21:39:57 EDT 2013


Have you looked into docopt?

-Modulok-


On Fri, Jun 28, 2013 at 7:36 PM, Ethan Furman <ethan at stoneleaf.us> wrote:

> On 06/27/2013 03:49 PM, Steven D'Aprano wrote:
>
>>
>> [rant]
>> I think it is lousy design for a framework like argparse to raise a
>> custom ArgumentError in one part of the code, only to catch it elsewhere
>> and call sys.exit. At the very least, that ought to be a config option,
>> and off by default.
>>
>> 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?
>
> --
> ~Ethan~
> --
> http://mail.python.org/**mailman/listinfo/python-list<http://mail.python.org/mailman/listinfo/python-list>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130628/0168ce7e/attachment.html>


More information about the Python-list mailing list