[issue11699] Documentation for get_option_group is wrong

Weeble report at bugs.python.org
Mon Mar 28 10:43:49 CEST 2011


New submission from Weeble <clockworksaint at gmail.com>:

The docs for optparse say this:

OptionParser.get_option_group(opt_str)
    Return, if defined, the OptionGroup that has the title or the long description equals to opt_str

After failing to get this to work at all, I looked at the implementation, and the documentation is completely wrong. The method takes an option string, like '-o' or '--option' and returns the option group that it belongs to.

Personally, I would much prefer the function to do what the documentation describes, i.e. find the option group with the given name, but I guess it's far too late for that. The scenario I'm in is that I'm writing a plugin for an existing tool which provides access to its OptionParser to add new options, but doesn't provide references to any of the groups that are already created.

It looks like this documentation was added recently:

http://bugs.python.org/issue1665333

----------
messages: 132385
nosy: weeble
priority: normal
severity: normal
status: open
title: Documentation for get_option_group is wrong

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11699>
_______________________________________


More information about the Python-bugs-list mailing list