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.

Title: Documentation missing for OptionGroup class in optparse
Type: Stage: patch review
Components: Documentation Versions: Python 3.1, Python 3.2, Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, akuchling, bethard, docs@python, eric.araujo, georg.brandl, lunar_yorn, nnorwitz, sandro.tosi, weeble
Priority: normal Keywords: patch

Created on 2007-02-21 15:40 by lunar_yorn, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
issue1665333-py3k.patch sandro.tosi, 2010-09-28 20:14
issue1665333-py3k-v2.patch sandro.tosi, 2010-09-28 20:34
Messages (14)
msg31302 - (view) Author: LunarYorn (lunar_yorn) Date: 2007-02-21 15:40
Python seems to lack documentation for the OptionGroup class and related methods in the optparse modul.

In detail documentation of the following classes and methods in optparse is missing:

- OptionGroup
- OptionParser.add_option_group
- OptionParser.get_option_group

These classes and methods also lack docstrings.

I found this in Python 2.4.4c1 which comes with Ubuntu 6.10 Edgy. It seems, that Python 2.5 on Ubuntu Edgy also suffers from this bug.
msg31303 - (view) Author: Steven Bethard (bethard) * (Python committer) Date: 2007-02-26 17:37
The docstrings need to be modified in the Optik package (from which the stdlib optparse module is derived). I've filed you an appropriate patch there: I'll see what I can do about adding some documentation. My preference is only to document OptionParser.add_option_group -- I think making the OptionGroup API public is a mistake (like making the STORE_ACTIONS, etc. APIs public was).
msg31304 - (view) Author: Steven Bethard (bethard) * (Python committer) Date: 2007-02-26 17:39
Looks like the optparse docs are also auto-generated from optik. Here's the first line of liboptparse.tex:


So I guess this needs to be handled in the optparse bugs.
msg31305 - (view) Author: LunarYorn (lunar_yorn) Date: 2007-02-26 17:45
Thanks for filing the patch there!  I didn't know, that optparse is developt outside of Python...

Anyway I think you're right not to comment the whole api.  I did not intend that.  I would be content with a little note in the docs quickly explains OptionGroups and how to create them.  More shouldn't be told, since they are only useful for formatting help output.

I just needed such a thing for my recent project and was short of overwriting the OptionParser and HelpFormatter classes.  For that purpose I looked into the sources, where I found the OptionGroup capabilities.  A little note would have shortened the development of the option parsing code quite a bit... ;)
msg31306 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2007-03-16 06:59
LunarYorn, thanks for the report.  bediviere, thanks to for filing a report with optik.  Since the issue  is tracked there, I'm closing this report.
msg75845 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2008-11-14 00:32
Re-opening, since Optik is no longer externally maintained.
msg116613 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-09-16 21:20
Should this be left with AMK or should it be reassigned to docs@python?
msg116617 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-09-16 21:32
Adding docs@ to nosy. amk: Please reassign to docs@ if you don’t intend to work on this.
msg117459 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2010-09-27 18:27
I will work on it, it noone objects.

msg117544 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2010-09-28 20:14
attached is a patch to improve the OptionGroup documentation. I've also changed usage->Usage and options->Options in the examples output, since now the code tries to guess the lower case word and rewrites with the capitalized one.

I'm willing to improve the patch in case there's something not good (and I bet there is, since it's my first complex patch for Python documentation) so please be nice :) and point me to parts that can be improved.

Thanks in advance,
msg117547 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2010-09-28 20:34
sorry, I forgot to wrap at column 80, this patch just changes that.
msg125040 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2011-01-02 09:58
Could someone give a look to this patch? I can work on fixing the missing stuff (if any :)).
msg125055 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2011-01-02 14:23
Looks good, applied in r87627 (after removing stray tabs).
msg132386 - (view) Author: Weeble (weeble) Date: 2011-03-28 08:45
I think the documentation for get_option_group is not right. I've created a new bug:
Date User Action Args
2022-04-11 14:56:22adminsetgithub: 44601
2011-03-28 08:45:06weeblesetnosy: + weeble
messages: + msg132386
2011-01-02 14:23:55georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg125055

resolution: fixed
2011-01-02 09:58:23sandro.tosisetnosy: akuchling, nnorwitz, bethard, lunar_yorn, eric.araujo, sandro.tosi, docs@python, BreamoreBoy
messages: + msg125040
stage: patch review
2010-11-12 21:04:11akuchlingsetassignee: akuchling ->
2010-09-28 20:34:00sandro.tosisetfiles: + issue1665333-py3k-v2.patch

messages: + msg117547
2010-09-28 20:14:51sandro.tosisetfiles: + issue1665333-py3k.patch
keywords: + patch
messages: + msg117544
2010-09-27 18:27:55sandro.tosisetnosy: + sandro.tosi
messages: + msg117459
2010-09-16 21:32:28eric.araujosetnosy: + docs@python, eric.araujo

messages: + msg116617
versions: + Python 3.1, Python 3.2
2010-09-16 21:20:10BreamoreBoysetnosy: + BreamoreBoy
messages: + msg116613
2008-11-14 00:32:11akuchlingsetstatus: closed -> open
versions: + Python 2.7, - Python 2.4
nosy: + akuchling
title: Documentation missing for OptionGroup class in optparse -> Documentation missing for OptionGroup class in optparse
messages: + msg75845
assignee: akuchling
resolution: not a bug -> (no value)
2007-02-21 15:40:20lunar_yorncreate