PEP proposal optparse

Pete Forman pete.forman at
Fri Sep 19 13:37:51 CEST 2008

James <jlnicolson at> writes:

 > I would like to know your thoughts on a proposed change to optparse
 > that I have planned. It is possible to add default values to
 > multiple options using the set_defaults. However, when adding
 > descriptions to options the developer has to specify it in each
 > add_option() call.


I see no advantage to swelling optparse when the language offers many
solutions already.  E.g.

desc = {
    'verbose': 'Output less information',
    'castordir': 'specify the wanted CASTOR directory where to store '
    'the results tarball',
    'previousrel': 'Top level dir of previous release for regression '

parser.add_option('-q', '--quiet', action="store_false",
                  dest='verbose', help = desc['verbose'])

Or another approach might be like this.

for ... in zip(...):

Pete Forman                -./\.-  Disclaimer: This post is originated
WesternGeco                  -./\.-   by myself and does not represent
pete.forman at    -./\.-   the opinion of Schlumberger or           -./\.-   WesternGeco.

More information about the Python-list mailing list