[Python-Dev] Python 2.7b1 and argparse's version action (original) (raw)

Steven Bethard steven.bethard at gmail.com
Sun Apr 18 21:38:10 CEST 2010


On Sun, Apr 18, 2010 at 4:03 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:

To deal with this in a backwards compatible way while remaining on the path to more conventional behaviour, I suggest the following:

1. For Python 2.7, deprecate just the "-v" default behaviour for the version. This means "--version" and "-v" will be set to invoke different actions when the version argument is supplied (the latter will trigger a deprecation warning if supplied, while the former will work normally).

It's not clear how you would do this. If you can suggest a patch, I'd be happy to consider it. However, and the moment, you get "-v" and "--version" by simply specifying ArgumentParser(..., version="XXX"). So how do you deprecate just the "-v"?

All I can imagine you mean is to issue a deprecation warning whenever a user of the script provides "-v" at the command line, but that seems sketchy to me - we'd be deprecating features of someone's application, not features of the argparse library.

Steve

Where did you get that preposterous hypothesis? Did Steve tell you that? --- The Hiphopopotamus



More information about the Python-Dev mailing list