Getopt / matching problem

Andrew Dalke dalke at dalkescientific.com
Sat Mar 23 16:35:40 EST 2002


Andy Gimblett:
>From the getopt module documentation:
>
>    Long options on the command line can be recognized so long as they
>    provide a prefix of the option name that matches exactly one of
>    the accepted options.  For example, it long_options is ['foo',
>    'frob'], the option --fo will match as --foo, but --f will not
>    match uniquely, so GetoptError will be raised.
>
>So it's nothing to worry about, just the documented behaviour, and
>really the way we'd want it to work, if you think about.

Hmm.  It's not the way I want it to work.  I didn't expect it to
work.  I don't like stemming because if it's used then it prevents
future version of the code from introducing a new option which
introduces ambiguous stemming.

                    Andrew
                    dalke at dalkescientific.com






More information about the Python-list mailing list