[Python-Dev] PEP 389: argparse - new command line parsing module (original) (raw)

Nick Coghlan ncoghlan at gmail.com
Mon Sep 28 14:34:36 CEST 2009


Doug Hellmann wrote:

On Sep 27, 2009, at 6:00 PM, Michael Foord wrote:

Brett Cannon wrote: I am going to state upfront that I am +1 for this and I encouraged Steven to submit this PEP on the stdlib-SIG. I still remember watching Steven's lightning talk at PyCon 2009 on argparse and being impressed by it (along with the rest of the audience which was obviously impressed as well).

I think argprase is a good improvement over what we have now (getopt and optparse), it's stable, considered best-of-breed by the community for a while (as shown as how many times argparse has been suggestion for inclusion), and Steven is already a core committer so is already set to maintain the code. That covers the usual checklist we have for even looking at a PEP to add a module to the standard library.

I've used argparse and really like it. I could also have done with the subcommand support in recent changes to unittest. +1 for inclusion. +1 as well. I wish I had been able to use this library for a recent project using sub-commands.

+1 here as well (although we should definitely find a way to use str.format strings instead of %-format ones... come to think of it, does even the logging module support str.format style formatting in Py3k?)

Reading through the argparse vs optparse comparison in the argparse docs when the topic of possibly adding it came up a few weeks back I kept going "yep, I've rolled my own version of that, oh, and that, yeah, that too...".

argparse probably wouldn't have helped me even if I'd known about it (due to license review overhead), but it certainly addressed a whole heap of problems I had encountered in practice, and in ways that were a lot cleaner than the comparatively hacky approaches I had used for my own purposes (internal testing and diagnostic scripts are like that...).

Cheers, Nick.

-- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia



More information about the Python-Dev mailing list