[Python-Dev] bug or feature? fixing argparse's default help value for version actions (original) (raw)
Steven Bethard steven.bethard at gmail.com
Thu May 20 18🔞45 CEST 2010
- Previous message: [Python-Dev] Reasons behind misleading TypeError message when passing the wrong number of arguments to a method
- Next message: [Python-Dev] bug or feature? fixing argparse's default help value for version actions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Sorry I haven't had time to get around to the argparse issues. I should have time this weekend. I need a release manager call on one of the issues though. Two things I assume are fine to fix at this stage:
- In the documentation, the '--version' example should either not use a shorthand, or should use the conventional '-V'
- In the documentation, the difference between the argparse and optparse ways of specifying versions needs to be mentioned in the section on migrating from optparse.
One thing I'm not sure about:
Right now, the default help value for the version action is None, which is pretty useless since it means that everyone has to type in the same help="show program's version number and exit" when they use the version action. Instead, the string "show program's version number and exit" should have been the default value for the help argument. To be explicit, right now everyone who adds a version to their argument parser has to write:
parser.add_argument('-V', action='version', version='',
help="show program's version number and exit")
With the fixed default value you would only have to write:
parser.add_argument('-V', action='version', version='')
Can this be considered a bug, i.e. something that can be committed before the RC? Or does it need to be considered a feature, i.e. at this point can never be added to Python 2.7?
Thanks, and sorry again for not having time for this until now,
Steve
Where did you get that preposterous hypothesis? Did Steve tell you that? --- The Hiphopopotamus
- Previous message: [Python-Dev] Reasons behind misleading TypeError message when passing the wrong number of arguments to a method
- Next message: [Python-Dev] bug or feature? fixing argparse's default help value for version actions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]