[getopt-sig] The bake-off
rsc@plan9.bell-labs.com
rsc@plan9.bell-labs.com
Thu, 30 May 2002 11:40:55 -0400
> D'ohh! I originally liked using a list, but I've decided that I prefer
> add_option(). I suppose I will leave the list interface there but
> undocumented. Anyone else care?
The thing is that Python programmers already know
how to deal with lists. So if you tell them that the options
being parsed are just a list, then they can figure out how
to do
optionlist.append(foo)
for themselves rather than need to learn add_option.
And since the help message uses the same order as the list,
they can figure out how
optionlist.insert(0, foo)
optionlist.extend([foo,bar,baz])
etc. will work.
If you stick to just add_option, you end up either
not having the expressiveness of the list operations
or having your own names for them.
Russ