[Python-Dev] Python 2.7b1 and argparse's version action

2010-04-18 Thread Tobias Herp
Hi, all, (I don't know whether the first attempt to post this went through; I could'nt find it, so I retry. My apologies for any inconvenience...) I noticed that Python 2.7 beta 1 now contains the argparse module, which might be a good thing. The code has been cleaned up, too, compared to the c

[Python-Dev] Python 2.7b1 and argparse's version action

2010-04-18 Thread Tobias Herp
Hi, all, I noticed that Python 2.7 beta 1 now contains the argparse module, which might be a good thing. The code has been cleaned up, too, compared to the current version 1.1. But there is still one issue with argparse; to tell the story from the beginning: The ArgumentParser class uses uses '

Re: [Python-Dev] Python 2.7b1 and argparse's version action

2010-04-18 Thread Tobias Herp
Ben Finney schrieb: > Nick Coghlan writes: > >> I would be a lot happier if argparse as a standard library module just >> followed optparse's lead here (i.e. defined '--version' only and punted >> on the shorthand form). >> >> To deal with this in a backwards compatible way while remaining on the

Re: [Python-Dev] Python 2.7b1 and argparse's version action

2010-04-18 Thread Tobias Herp
Steven Bethard schrieb: > On Sun, Apr 18, 2010 at 3:31 AM, Tobias Herp wrote: >> To put it short: >> *Argparse should simply do this like optparse does already.* >> I.e., use '--version', '--help' and '-h' by default, but not '-v'

Re: [Python-Dev] Python 2.7b1 and argparse's version action

2010-04-18 Thread Tobias Herp
Steven Bethard schrieb: > On Sun, Apr 18, 2010 at 4:03 AM, Nick Coghlan 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 >>

Re: [Python-Dev] Python 2.7b1 and argparse's version action

2010-04-18 Thread Tobias Herp
Eric Smith schrieb: > Steven Bethard wrote: >> By the way, we could simplify the typical add_argument usage by adding >> "show program's version number and exit" as the default help for the >> 'version' action. Then you should just write: >> >> parser.add_argument('--version', action='version',

Re: [Python-Dev] Python 2.7b1 and argparse's version action

2010-04-18 Thread Tobias Herp
Steven Bethard schrieb: > On Sun, Apr 18, 2010 at 3:52 PM, Antoine Pitrou wrote: >> Steven Bethard gmail.com> writes: >>> Note >>> that even though I agree with you that "-v/--version" is probably not >>> the best choice, in the poll[2] 11% of people still wanted this. >> >> This strikes me as a

Re: [Python-Dev] Python 2.7b1 and argparse's version action

2010-04-18 Thread Tobias Herp
Steven Bethard schrieb: > On Sun, Apr 18, 2010 at 2:35 PM, Tobias Herp wrote: >> Steven Bethard schrieb: >>> On Sun, Apr 18, 2010 at 3:31 AM, Tobias Herp wrote: >>>> *Argparse should simply do this like optparse does already.* >>>> I.e., use '--vers

Re: [Python-Dev] Python 2.7b1 and argparse's version action

2010-04-20 Thread Tobias Herp
Barry Warsaw schrieb: > On Apr 18, 2010, at 07:30 PM, Eric Smith wrote: > >> Steven Bethard wrote: >>> By the way, we could simplify the typical add_argument usage by adding >>> "show program's version number and exit" as the default help for the >>> 'version' action. Then you should just write: >

Re: [Python-Dev] Python 2.7b1 and argparse's version action

2010-04-20 Thread Tobias Herp
Nick Coghlan schrieb: > Tobias Herp wrote: >> No deprecation or removal of the simple and convenient 'version' >> argument is needed for this. Just omit it, and build your version >> action yourself. But please notice that there are others who appreciate >&g

Re: [Python-Dev] Python 2.7b1 and argparse's version action

2010-04-20 Thread Tobias Herp
"Martin v. Löwis" schrieb: >> - many optparse programs use the version argument >> - many other programmers find this feature very convenient >> - dropping or deprecating this is a totally unnecessary change >> (I have not read a single real reason /why/ this should be done). > > You actually br