getopt: where's da dicts?????

Thomas A. Bryan tbryan at python.net
Tue Oct 19 21:06:49 EDT 1999


"Fred L. Drake, Jr." wrote:

[...summarizing his response to complaints about Python's getopt...]

>   (No, I'm not saying a better approach isn't desirable or warranted,
> just trying to point out one of the issues.)

As I mentioned elsewhere in this thread, I really like DPyGetOpt
from www.python.org's ftp site (under Contrib/System, I think).  
Those reading this thread may be interested to know that I recently 
pestered the Guido to see whether some expanded option processing 
would be included in Python's standard library before Python 2, if ever.
(Getting into Python's standard lib was part of DPyGetOpt's original
goal.)

Guido responded:
"""
There are plenty of 3rd party option processors already out there, so
why would you want to write another one?  getopt has short and long
options.  What more do you want?  Beyond what getopt offers, it's hard 
to choose a feature set that satisfies every need, and in the sake of
keeping Python simple (the KISS principle) I don't think it's worth
adding another one to the core library.
"""

After a rambling reply trying to justify my request, I was forced to 
concede that 
"""
After thinking about it more, I suppose that my preferences are just
that...*my* preferences.  I was actually hoping that the current getopt
could be *replaced* by a new one with some *extra* optional features
that
the current getopt doesn't provide, but perhaps those of us who don't
use
Python's getopt wouldn't be able to agree on an extended feature set
that
we all liked. :)
"""

For example, I prefer -long to --long options.  I also liked 
DPyGetOpt's arguments with optional parameters, and now I've 
heard why I might want to rethink that position from both Guido
and Fred.

Anyway, I think that I agree with Guido.  The current getopt in Python 
is minimal but complete.  If I need more, I don't mind using third party
modules since they're all small enough to package with an app, and I
like
the Python library in part because it doesn't try to provide everything
that any single person has requested.

Just my import math;math.log(math.pow(math.e,2)) cents.
---Tom




More information about the Python-list mailing list