I want to start working on an alpha release of Python 2.3. I'd like to be able to release 2.3a1 before Xmas. PEP 283 has a list of things to be done. One of the tasks is to adopt Greg Ward's options parsing module, Optik. I propose to adopt this under the name "options". Any comments? --Guido van Rossum (home page: http://www.python.org/~guido/)
[Guido van Rossum]
I want to start working on an alpha release of Python 2.3. I'd like to be able to release 2.3a1 before Xmas. PEP 283 has a list of things to be done. One of the tasks is to adopt Greg Ward's options parsing module, Optik. I propose to adopt this under the name "options". Any comments?
+0 The name is basically fine, if just a little vague. But then again I really doubt someone learning programming knows what getopt traditionally means. But I don't have a better name, so I can't really complain. Best I can do is ArgParser or something to try to tie the name into sys.argv. And I completely support making sure that it doesn't have a cute name. -Brett
Brett Cannon
Best I can do is ArgParser or something to try to tie the name into sys.argv.
How about argvparse, by analogy with urlparse? Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg@cosc.canterbury.ac.nz +--------------------------------------+
David Ascher
Greg Ewing wrote:
Brett Cannon :
Best I can do is ArgParser or something to try to tie the name into sys.argv.
How about argvparse, by analogy with urlparse?
or argparse. The v is archaic and so silent it fades away =)
-1 With one /single/ character, 'argvparse' disambiguates that we're talking about command-line arguments. You can't beat that for semantic value. -- David Abrahams dave@boost-consulting.com * http://www.boost-consulting.com Boost support, enhancements, training, and commercial distribution
[Greg Ewing]
Brett Cannon
: Best I can do is ArgParser or something to try to tie the name into sys.argv.
How about argvparse, by analogy with urlparse?
+1 As David Abrahams pointed out in another email, having the "v" in their helps deal with any possible ambiguity. Now I know Guido suggested ``optlib`` and Greg liked it. But I don't like the idea of associating the package with the *lib modules in the stdlib. If you look at the stdlib we have modules like ftplib, htmllib, zlib, and urllib. I view these modules as collections of methods and classes that have a common theme, but where each method and class can be used in isolation; they are collections of utility methods and classes. They are not part of some single, large functionality like Optik is. And yes, I realize that urlparse is more like what I described above, but it is not a habit in the library yet. But if this *lib association sticks, I like ``optlib``. And since all of these name suggestions are ending up in all of these emails (and I have to know them for the Summary anyway), the following is best as I know so far. If someone has thrown their support behind another name, I only list their last supported name. optlib: Guido van Rossum, Greg Ward cmdline: cmdopts: Ka-Ping Yee, David Abrahams argvparse: Greg Ewing, Brett Cannon argparse: David Ascher
Brett Cannon
And since all of these name suggestions are ending up in all of these emails (and I have to know them for the Summary anyway), the following is best as I know so far. If someone has thrown their support behind another name, I only list their last supported name.
optlib: Guido van Rossum, Greg Ward
cmdline: cmdopts: Ka-Ping Yee, David Abrahams
argvparse: Greg Ewing, Brett Cannon
I'll vote for argvparse as well if it helps to break a tie.
argparse: David Ascher
-- David Abrahams dave@boost-consulting.com * http://www.boost-consulting.com Boost support, enhancements, training, and commercial distribution
"BC" == Brett Cannon
writes:
BC> optlib: Guido van Rossum, Greg Ward BC> cmdline: BC> cmdopts: Ka-Ping Yee, David Abrahams BC> argvparse: Greg Ewing, Brett Cannon BC> argparse: David Ascher Cute names be celebrated, the obvious choice now is "argument". :) this-is-getting-hit-on-the-head-lessons-ly y'rs, -Barry
On 13 November 2002, Guido van Rossum said:
I want to start working on an alpha release of Python 2.3. I'd like to be able to release 2.3a1 before Xmas. PEP 283 has a list of things to be done. One of the tasks is to adopt Greg Ward's options parsing module, Optik. I propose to adopt this under the name "options". Any comments?
I have yet to be thrilled by any of the proposed names, and I'm not
thrilled by this one. It's possible that I dislike it slightly less
than OptionParser, which has been my working title for ages now.
BTW, several weeks ago I wrote a script to do much of the grunt work.
If you have the Optik CVS tree checked out, this:
./merge optik.py
will merge the relevant code from lib/*.py into optik.py. Change the
output name to suit your taste, of course.
Still haven't done anything about the test suite, which is probably the
main reason I've been procrastinating on this. (Oh yeah, the docs too.)
Greg
--
Greg Ward
"GW" == Greg Ward
writes:
GW> Still haven't done anything about the test suite, which is GW> probably the main reason I've been procrastinating on this. (Oh GW> yeah, the docs too.) They can probably wait until the distutils docs are done. Jeremy
On 13 November 2002, Jeremy Hylton said:
GW> Still haven't done anything about the test suite, which is GW> probably the main reason I've been procrastinating on this. (Oh GW> yeah, the docs too.)
They can probably wait until the distutils docs are done.
Ouch! That was low. ;-) BTW, Optik *is* copiously documented -- it's
just a question of LaTeX-ifying the docs.
Greg
--
Greg Ward
Let's assume we'll stick with optparse as the module name. There are still a few references to Optik in the source code, in particular there's an exception class OptikError. (The other mentions are in comments.) Should I rename OptikError to OptParseError, or leave it? --Guido van Rossum (home page: http://www.python.org/~guido/)
Ka-Ping Yee wrote:
On Thu, 14 Nov 2002, Guido van Rossum wrote:
Should I rename OptikError to OptParseError, or leave it?
I like optparse, and i think it's a good idea to call the corresponding error OptParseError.
Agreed. Now's the time to get rid of the legacy code.
[Guido van Rossum]
[...] One of the tasks is to adopt Greg Ward's options parsing module, Optik. I propose to adopt this under the name "options". Any comments?
My feeling is that Python should much avoid, for a library module, a name which is likely to be a user variable name. This would rule out "options". In my experience so far, the most irritating cases in Python hurding common words for itself have been `string' and `socket'. I know that some people write `s' for a string and would write `o' for options, but this algebraic style is not ideal. I find that using real words, like `counter', `ordinal', `cursor', `index' or such, yields more readable programs. When one "imports" a module, one has to give up using the module name for other purposes. Currently, I think _all_ my callable scripts which handle options already use `options' for a variable name, so I would prefer that `options' be left alone. This is why I think Python should not offer a module named "text" for example. As a principle for the future, let simple, common words be available to users for naming their own variables. -- François Pinard http://www.iro.umontreal.ca/~pinard
On Thursday 14 November 2002 09:40, François Pinard wrote:
When one "imports" a module, one has to give up using the module name for other purposes.
Just a quick side note, you can always do things like: import socket SocketModule = socket socket = open( "blah blah blah") Which may be un-pythonic, but not too onerous, imo. Now that the string module is kind of superfluous, you may be able to start using 'string' as a variable name (I'd still avoid it for another five years, though. :) I think the point is well taken, however. Global namespace aliasing is a problem with many languages, and as python officially adopts more and more modules into the mainline, the current ad-hoc naming style could become a problem. Some early modules already appropriate common useful variable names (signal, thread, etc.), and there seems to be a trend of new modules trying to avoid this with different methods (Capitalization, -lib suffix, etc.) Perhaps we should discuss (if it hasn't been discussed to death already) a format to adopt for all future included modules, to make things sane. We could even consider renaming the old modules that don't fit the pattern (keeping the old names as well, but deprecating them) For example, I think modules should avoid being singular nouns. They should instead describe (or hint at) what services they provide, not what kind of object they provide. So, the 'socket' module would be better as 'sockets', because someone is more likely to use a temporary "socket" variable than the "sockets" variable. Furthermore, I don't particularly like the "lib" suffix, but it is useful for being short, and makes clear that it provides services. Lots of modules are using it, maybe we should formalize its use. Should we allow mixed case module names in the standard distribution module names? Yes or no? I suppose I don't really care, if other naming issues are worked out. But in general I prefer lowercase, which makes choosing the right name more important. So "Queue" would possibly be better as 'queues', but not as 'queue'. Oh well, enough rambling. Maybe it isn't that big a deal, not worthy of wasting too much time on. But as time goes on and the module namespace gets more crowded, the ad-hoc naming scheme starts to look a little rustic. -- Chad Netzer cnetzer@mail.arc.nasa.gov
[Guido van Rossum]
[...] One of the tasks is to adopt Greg Ward's options parsing module, Optik. I propose to adopt this under the name "options". Any comments?
For what it might be worth, from all suggestions I've seen so far, "OptionParser" is the one I like best, because of the pre-existence of "ConfigParser", and the similarity between goals and complexity level. I understand that OptionParser is _also_ a class among others in those offered, and some of us do not see a reason to _give preference_ to one particular class. I would rather the module name also being one of its class name as a mere coincidence or accident, rather than the indication that some preference was given. The objection against it is not strong. In a previous message, I told why "options" looks a bad choice to me. The next worse is probably "optlib", because its ambiguity makes it pretty meaningless. Maybe that "Optik" could be retained as yet another possibility? It might not be so bad, all considered. ;-) -- François Pinard http://www.iro.umontreal.ca/~pinard
participants (11)
-
barry@python.org
-
Brett Cannon
-
Chad Netzer
-
David Abrahams
-
David Ascher
-
Greg Ewing
-
Greg Ward
-
Guido van Rossum
-
Jeremy Hylton
-
Ka-Ping Yee
-
pinard@iro.umontreal.ca