New submission from Weeble <clockworksa...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue11699>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to