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.
Created on 2011年03月28日 08:43 by weeble, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue11699.patch | petri.lehtinen, 2011年07月30日 05:08 | |||
| Messages (10) | |||
|---|---|---|---|
| msg132385 - (view) | Author: Weeble (weeble) | Date: 2011年03月28日 08:43 | |
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 |
|||
| msg141311 - (view) | Author: Petri Lehtinen (petri.lehtinen) * (Python committer) | Date: 2011年07月28日 18:42 | |
Attached a patch for 2.7. |
|||
| msg141341 - (view) | Author: Eli Bendersky (eli.bendersky) * (Python committer) | Date: 2011年07月29日 11:00 | |
Petri, I think the "to" after "belongs" is redundant. Also, the issue lists 3.2 and 3.3 - is the fix relevant there too? If yes, can you prepare a patch for 3.2? (I will merge it to 3.3 too) |
|||
| msg141360 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年07月29日 12:41 | |
Yep, the "to" is already present before the verb :) I think we mark None as ``None``, not *None*. (If the rest of the file does otherwise, then do that.) |
|||
| msg141423 - (view) | Author: Petri Lehtinen (petri.lehtinen) * (Python committer) | Date: 2011年07月30日 05:08 | |
Updated the patch: - Removed the extra "to" - Changed *None* to ``None`` for conformance with the rest of the file The same patch applies unmodified to 2.7 and 3.2 branches. |
|||
| msg141424 - (view) | Author: Eli Bendersky (eli.bendersky) * (Python committer) | Date: 2011年07月30日 05:12 | |
Armin, adding you as the optparse expert - could you see the doc change makes sense? [I will then do the commit work] |
|||
| msg141427 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2011年07月30日 07:07 | |
It does make sense, please commit. |
|||
| msg141431 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年07月30日 08:14 | |
New changeset 5a248fcfa112 by Eli Bendersky in branch '2.7': Issue #11699: fix documentation of OptionParser.get_option_group. Patch by Petri Lehtinen http://hg.python.org/cpython/rev/5a248fcfa112 |
|||
| msg141433 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年07月30日 08:39 | |
New changeset cfb60dfa7734 by Eli Bendersky in branch '3.2': Issue #11699: fix documentation of OptionParser.get_option_group. Patch by Petri Lehtinen http://hg.python.org/cpython/rev/cfb60dfa7734 New changeset 27b588dd6155 by Eli Bendersky in branch 'default': Merge 3.2: Issue #11699: fix documentation of OptionParser.get_option_group. Patch by Petri Lehtinen http://hg.python.org/cpython/rev/27b588dd6155 |
|||
| msg141434 - (view) | Author: Eli Bendersky (eli.bendersky) * (Python committer) | Date: 2011年07月30日 08:43 | |
Done. Petri - thanks for the contribution. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:15 | admin | set | github: 55908 |
| 2011年07月30日 13:30:30 | eric.araujo | set | stage: patch review -> resolved |
| 2011年07月30日 08:43:31 | eli.bendersky | set | status: open -> closed resolution: fixed messages: + msg141434 |
| 2011年07月30日 08:39:44 | python-dev | set | messages: + msg141433 |
| 2011年07月30日 08:14:56 | python-dev | set | nosy:
+ python-dev messages: + msg141431 |
| 2011年07月30日 07:07:33 | georg.brandl | set | messages: + msg141427 |
| 2011年07月30日 05:12:41 | eli.bendersky | set | nosy:
+ aronacher messages: + msg141424 |
| 2011年07月30日 05:08:49 | petri.lehtinen | set | files: - issue11699.patch |
| 2011年07月30日 05:08:37 | petri.lehtinen | set | files:
+ issue11699.patch messages: + msg141423 |
| 2011年07月29日 12:41:16 | eric.araujo | set | messages: + msg141360 |
| 2011年07月29日 11:00:14 | eli.bendersky | set | messages: + msg141341 |
| 2011年07月29日 07:56:04 | eli.bendersky | set | nosy:
+ eli.bendersky |
| 2011年07月28日 18:42:56 | petri.lehtinen | set | stage: patch review |
| 2011年07月28日 18:42:37 | petri.lehtinen | set | files:
+ issue11699.patch versions: - Python 3.1 nosy: + petri.lehtinen messages: + msg141311 keywords: + patch, easy, needs review |
| 2011年05月28日 12:49:13 | adam.woodbeck | set | nosy:
+ adam.woodbeck |
| 2011年04月02日 00:06:28 | terry.reedy | set | title: Documentation for get_option_group is wrong -> Doc for optparse.OptionParser.get_option_group is wrong |
| 2011年03月28日 15:38:06 | eric.araujo | set | nosy:
+ nnorwitz, georg.brandl, lunar_yorn, eric.araujo, docs@python assignee: docs@python components: + Documentation versions: + Python 3.1, Python 2.7, Python 3.2, Python 3.3 |
| 2011年03月28日 08:48:40 | sandro.tosi | set | nosy:
+ sandro.tosi |
| 2011年03月28日 08:43:49 | weeble | create | |