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

2010-04-21 Thread Nick Coghlan
Tobias Herp wrote: What /is/ this ambiguity of the version= argument? There is none! Do it the way optparse does it, and all is fine! All is not fine. How do I add a -V shortcut that is equivalent to --version as part of an optparse program? (That's a real question, I honestly have no idea

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 Nick Coghlan
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 this simple way to do it and don't need more. One Obvious Way. In

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

2010-04-20 Thread Martin v. Löwis
Nick Coghlan wrote: 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 this simple way to do it and don't need more.

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 this simple way to do it and don't need more.

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 brought up a

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

2010-04-20 Thread Stephen J. Turnbull
Tobias Herp writes: (we use Python because it is convenient!), Speak for yourself, I want no part of that we. I use Python because it's well defined and well documented and makes sense and provides powerful operations and runs quickly enough in those applications where I use it. The fact

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

2010-04-19 Thread Paul Moore
On 19 April 2010 04:44, Ron Adam r...@ronadam.com wrote: Note that the python interpreter uses -V and --version. r...@gutsy:~$ python3.1 -V Python 3.1.2 r...@gutsy:~$ python3.1 --version Python 3.1.2 And -v is used as follows: -v     : verbose (trace import statements); also

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

2010-04-19 Thread Brett Cannon
I'm with Martin; just let it be explicit and stick an example in the docs. -Brett (from his phone with hopefully only one copy sent of this email) On Apr 18, 2010 9:22 PM, Martin v. Löwis mar...@v.loewis.de wrote: - many optparse programs use the version argument - many other programmers find

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

2010-04-19 Thread Scott Dial
On 4/18/2010 9:44 PM, Steve Holden wrote: Tobias Herp wrote: Steven Bethard schrieb: On Sun, Apr 18, 2010 at 2:35 PM, Tobias Herp tobias.h...@gmx.de wrote: Steven Bethard schrieb: But I'd really like a consensus about the correct behavior, and so far I have not seen that. Do you take your

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

2010-04-19 Thread Michael Foord
On 19/04/2010 21:19, Scott Dial wrote: On 4/18/2010 9:44 PM, Steve Holden wrote: Tobias Herp wrote: Steven Bethard schrieb: On Sun, Apr 18, 2010 at 2:35 PM, Tobias Herptobias.h...@gmx.de wrote: Steven Bethard schrieb: But I'd really like a consensus

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

2010-04-19 Thread Steven Bethard
On Mon, Apr 19, 2010 at 12:51 PM, Michael Foord fuzzy...@voidspace.org.uk wrote: On 19/04/2010 21:19, Scott Dial wrote: Is consensus superficial? No, but it isn't always possible or necessary. In general the maintainer of a module should make the best decision, not the one with the most

[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

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

2010-04-18 Thread Nick Coghlan
Tobias Herp wrote: *Before Python 2.7 reaches productivity stage*, 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

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

2010-04-18 Thread Ben Finney
Nick Coghlan ncogh...@gmail.com 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 path to more

[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 ncogh...@gmail.com 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

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

2010-04-18 Thread Steven Bethard
On Sun, Apr 18, 2010 at 3:31 AM, Tobias Herp tobias.h...@gmx.de 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'. [snip] What happened was the following: Completely unnecessarily, the

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

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

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 tobias.h...@gmx.de 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'. [snip] What happened was the following: Completely

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 ncogh...@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

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

2010-04-18 Thread Antoine Pitrou
Steven Bethard steven.bethard at gmail.com writes: I need to a see a consensus from a variety of developers that --version is the right answer, and not -V/--version, etc. Both are ok for me. -v as a shortcut for --version looks wrong, though. -v is almost always used for verbosity these

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

2010-04-18 Thread Nick Coghlan
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', version='the version') With

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

2010-04-18 Thread Michael Foord
On 19/04/2010 00:52, Antoine Pitrou wrote: Steven Bethardsteven.bethardat gmail.com writes: I need to a see a consensus from a variety of developers that --version is the right answer, and not -V/--version, etc. Both are ok for me. -v as a shortcut for --version looks wrong,

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

2010-04-18 Thread Steven Bethard
On Sun, Apr 18, 2010 at 3:57 PM, Nick Coghlan ncogh...@gmail.com 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-18 Thread Steven Bethard
On Sun, Apr 18, 2010 at 3:52 PM, Antoine Pitrou solip...@pitrou.net wrote: Steven Bethard steven.bethard at 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 small

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

2010-04-18 Thread Eric Smith
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', version='the version') I like

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

2010-04-18 Thread Nick Coghlan
Steven Bethard wrote: On Sun, Apr 18, 2010 at 3:57 PM, Nick Coghlan ncogh...@gmail.com 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

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 solip...@pitrou.net wrote: Steven Bethard steven.bethard at 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.

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 tobias.h...@gmx.de wrote: Steven Bethard schrieb: On Sun, Apr 18, 2010 at 3:31 AM, Tobias Herp tobias.h...@gmx.de wrote: *Argparse should simply do this like optparse does already.* I.e., use '--version', '--help' and '-h'

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

2010-04-18 Thread Nick Coghlan
Tobias Herp wrote: Be careful. There have been other personal opinions, and there are very many *X programs which form a standard which should be followed, and this is a /very strong/ argument, IMO. If the version= argument were to only provide --version, how would you conveniently add a -V

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

2010-04-18 Thread Cameron Simpson
On 18Apr2010 22:52, Antoine Pitrou solip...@pitrou.net wrote: | Steven Bethard steven.bethard at gmail.com writes: | I | need to a see a consensus from a variety of developers that | --version is the right answer, and not -V/--version, etc. | | Both are ok for me. -v as a shortcut for

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

2010-04-18 Thread Steve Holden
Tobias Herp wrote: Steven Bethard schrieb: On Sun, Apr 18, 2010 at 2:35 PM, Tobias Herp tobias.h...@gmx.de wrote: Steven Bethard schrieb: On Sun, Apr 18, 2010 at 3:31 AM, Tobias Herp tobias.h...@gmx.de wrote: *Argparse should simply do this like optparse does already.* I.e., use '--version',

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

2010-04-18 Thread Ian Bicking
On Sun, Apr 18, 2010 at 6:24 PM, Steven Bethard steven.beth...@gmail.comwrote: On Sun, Apr 18, 2010 at 3:52 PM, Antoine Pitrou solip...@pitrou.net wrote: Steven Bethard steven.bethard at gmail.com writes: Note that even though I agree with you that -v/--version is probably not the best

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

2010-04-18 Thread Barry Warsaw
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: parser.add_argument('--version',

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

2010-04-18 Thread Ben Finney
Tobias Herp tobias.h...@gmx.de writes: Steven Bethard schrieb: On Sun, Apr 18, 2010 at 3:52 PM, Antoine Pitrou solip...@pitrou.net wrote: Steven Bethard steven.bethard at gmail.com writes: Note that even though I agree with you that -v/--version is probably not the best choice, in the

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

2010-04-18 Thread Steve Holden
Cameron Simpson wrote: On 18Apr2010 22:52, Antoine Pitrou solip...@pitrou.net wrote: | Steven Bethard steven.bethard at gmail.com writes: | I | need to a see a consensus from a variety of developers that | --version is the right answer, and not -V/--version, etc. | | Both are ok for me.

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

2010-04-18 Thread Ron Adam
On 04/18/2010 05:57 PM, Nick Coghlan 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: parser.add_argument('--version',

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

2010-04-18 Thread Ron Adam
On 04/18/2010 06:35 PM, Nick Coghlan wrote: Steven Bethard wrote: On Sun, Apr 18, 2010 at 3:57 PM, Nick Coghlanncogh...@gmail.com 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

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

2010-04-18 Thread Martin v. Löwis
- 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 brought up a good reason yourself: In

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

2010-04-18 Thread Steven Bethard
On Sun, Apr 18, 2010 at 4:35 PM, Nick Coghlan ncogh...@gmail.com wrote: Steven Bethard wrote: On Sun, Apr 18, 2010 at 3:57 PM, Nick Coghlan ncogh...@gmail.com wrote: Steven Bethard wrote: By the way, we could simplify the typical add_argument usage by adding show program's version number and

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

2010-04-18 Thread Steven Bethard
On Sun, Apr 18, 2010 at 6:40 PM, Nick Coghlan ncogh...@gmail.com wrote: Note there are two changes I believe should be made to the argparse documentation for 2.7 though: - the '--version' example should either not use a shorthand, or should use the conventional '-V' - this issue needs to be

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

2010-04-18 Thread Steven Bethard
On Sun, Apr 18, 2010 at 7:02 PM, Ian Bicking i...@colorstudy.com wrote: Somewhat relatedly, what is the plan for past and future argparse releases? I currently don't have any plans to make releases outside of the main Python releases. Perhaps if there's great demand for it, I'll reconsider, but