This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author weeble
Recipients weeble
Date 2011-03-28.08:43:48
SpamBayes Score 2.0722554e-07
Marked as misclassified No
Message-id <1301301829.71.0.0713641718569.issue11699@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2011-03-28 08:43:49weeblesetrecipients: + weeble
2011-03-28 08:43:49weeblesetmessageid: <1301301829.71.0.0713641718569.issue11699@psf.upfronthosting.co.za>
2011-03-28 08:43:48weeblelinkissue11699 messages
2011-03-28 08:43:48weeblecreate