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

Fred L. Drake, Jr. fdrake at acm.org
Tue Oct 19 10:49:50 EDT 1999


Les Schaffer writes:
 > still, after /F's comment this morning, i had to strain my brain too
 > hard to try and imagine (creating) an app where arg order
 > mattered. all i could think of was tar -- and if i had written that

  tar is a really painful example, and I won't argue that
order-dependent options are a good thing, but is more of a style issue 
than anything else; Python allows you to do something else by using a
different option-processing model.
  Even with order-independent options, something to consider is
options which may be repeated; often we write code for which --verbose
(or -v) may be repeated to increase the level of messages that are
written out.  getopt supports this easily; an alternate module that
allows this needs some way to specify this behavior.  Not too
difficult, but just another wrinkle in what the processor needs to
understand.  There are enough wrinkles to get reasonably desirable
behaviors that it actually becomes fairly tedious code.
  (No, I'm not saying a better approach isn't desirable or warranted,
just trying to point out one of the issues.)


  -Fred

--
Fred L. Drake, Jr.	     <fdrake at acm.org>
Corporation for National Research Initiatives




More information about the Python-list mailing list