[getopt-sig] there isn't really any discussion here
Tim Peters
tim.one@home.com
Thu, 14 Feb 2002 03:32:07 -0500
[Russ Cox]
> ...
> It's not clear that one group is right and one group is wrong.
It doesn't even matter if one group *is* right and the other wrong: the
only thing this SIG has to decide is which way is most Pythonic.
Unfortunately, that's harder than distinguishing good from evil <wink>.
> I think it's basically a difference of opinion about what constitutes
> the best approach to the problem. Unfortunately I don't see any good
> way to sate both groups simultaneously.
We don't have to: it's quite Pythonic to pick a winner, then move on.
Your approach is elegant to the point of transparency. That's very
Pythonic.
OTOH, uniformity is supremely Pythonic, and Optik has several advantages
there:
+ Every Optik client generates the same kind of error msgs for a variety
of errors (like missing argument, or unrecognized option name). This
is also true of getopt() clients, and is a real help to end users
(they're not really fascinated by endless variations in common error
messages).
+ Whenever Optik takes care of string-to-whatever conversion, "the
rules" for exactly what can be converted and how it's done are the
same across clients. So saying, e.g., "integer argument" has a well-
defined meaning across clients. Also true of getopt clients, and
again it's also valuable to have uniformity across programs in how
failing conversions get reported.
+ Optik supplies policy for how options and argument values get
reported back to you (as attributes of an object). Current practice
is a mess, storing option existence flags and argument values in as
many diverse ways as getopt-loop authors have been able to dream up.
This makes it harder to follow other peoples' code, and offering
too much choice in what should be dull-as-dirt boilerplate code is
downright anti-pythonic. So are long function argument lists and/or
masses of global variables. People *should* often set up objects
to carry options around, but laziness stops them. Optik all but
forces them into better practice, and that's quite appealing to
the Pythonic mind.
+ Auto-generating a help msg in a uniform-across-clients way is also
a value. Ditto forcing all clients to have the same meaning for -h.
OTOH, everything else in Optik is useless fluff <wink>.