bug or feature? fixing argparse's default help value for version actions
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='<the 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='<the 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
On Thu, May 20, 2010 at 09:18, Steven Bethard <steven.bethard@gmail.com> wrote:
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='<the 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='<the 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?
In the end it's Benjamin's call, but my vote is to make the change. The chances someone wanted None as their help message is so bloody small and this is such a good UX change that I'm +1 on making the change. -Brett
Brett Cannon wrote:
In the end it's Benjamin's call, but my vote is to make the change. The chances someone wanted None as their help message is so bloody small and this is such a good UX change that I'm +1 on making the change.
I completely agree. -- Eric.
2010/5/20 Steven Bethard <steven.bethard@gmail.com>:
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.
Documentation changes are always okay.
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?
That sounds fine to me.
Thanks, and sorry again for not having time for this until now,
-- Regards, Benjamin
participants (4)
-
Benjamin Peterson
-
Brett Cannon
-
Eric Smith
-
Steven Bethard