[Python-Dev] PEP 389: argparse - new command line parsing module

Barry Warsaw barry at python.org
Wed Sep 30 03:30:04 CEST 2009


On Sep 29, 2009, at 9:18 PM, Nick Coghlan wrote:

> Keeping getopt around *and* including a "add_getopt_arguments"  
> method in
> argparse is probably the best of both worlds, in that it allows for
> relatively straightforward evolution of an application:
>
> 1. Start with getopt
> 2. As the getopt argument parsing gets twisty and arcane and  
> maintaining
> the help string becomes a nightmare, move to argparse with the
> "add_getopt_arguments" method.
> 3. Over time, convert more arguments to proper argparse arguments with
> full documentation.

Maybe.  I haven't been following this entire thread, but I don't see  
much point in making it easy to go from getopt to argparse.  The two  
are so different that I think you're either going to jump all in or  
not.  Maybe that's just me though as I really don't see much use for  
getopt any more (even for throwaway scripts).

-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 832 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/python-dev/attachments/20090929/6dfb7d8d/attachment-0001.pgp>


More information about the Python-Dev mailing list