Python 2.7b1 and argparse's version action

Chris Rebert clp2 at rebertia.com
Sat Apr 17 22:09:03 EDT 2010


On Sat, Apr 17, 2010 at 6:53 PM, Tobias Herp
<bruno-der-fragwuerdige at arcor.de> wrote:
> Hi, all,
>
> I notice that Python 2.7 beta 1 now contains the argparse module, which
> might be a good thing.  The code has been cleaned up, too.
>
> But there is still one issue with argparse:
> Completely unnecessarily, the 'version' constructor argument is now
> deprecated.  This fact doesn't solve any problem I can think of; the
> only effect is to make programming more cumbersome, and it is /one more/
> difference to optparse.
<snip>
> *Before Python 2.7 getting a production release*, IMNSHO the following
> changes should be applied to argparse.py:
>
> - removal of the deprecation warnings
> - removal of the default usage of '-v'
>  with the version information facility
>
> This is a very simple thing to do; I'd happily provide a patch.
>
> Just for the records, this is what optparse does:
> - it defines -h and --help for the help (unless suppressed)
> - it defines --version for the version (if version argument given)
> This is how it should be.
> This is how the vast majority of *x tools looks like.
>  (well, some use '-h' for something like "host" or "human readable";
>  but just a few strange misfits use -v instead of -V for the version.)
> No reason to change this behaviour.
>
> What do you think?

You'd probably ought to just complain upstream to the argparse project
itself. The change doesn't seem to have been made specifically for std
lib inclusion (though I didn't read the bug in depth).

This looks like the relevant issue:
http://code.google.com/p/argparse/issues/detail?id=43

Relevant revision:
http://code.google.com/p/argparse/source/detail?r=83

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list