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.

classification
Title: incorrect documentation for optparse
Type: Stage:
Components: Documentation Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: gward Nosy List: georg.brandl, gward, popuptoaster
Priority: normal Keywords:

Created on 2005-11-25 12:22 by popuptoaster, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg26920 - (view) Author: Michael Dunn (popuptoaster) Date: 2005-11-25 12:22
The page
http://www.python.org/doc/current/lib/optparse-parsing-arguments.html
in the current documentation has text with an incorrect
example:

"""
6.21.3.7 Parsing arguments
The whole point of creating and populating an
OptionParser is to call its parse_args() method:
(options, args) = parser.parse_args(args=None,
options=None)
where the input parameters are
args
 the list of arguments to process (sys.argv[1:] by
default) 
options
 object to store option arguments in (a new instance of
optparse.Values by default)
"""

The example should be changed to:

(options, args) = parser.parse_args(args=None,
        values=None)
        ^^^^^^

And then there should be a correstponding substition
below in the explanation of the keyword arguments:

values
^^^^^^
 object to store option arguments in (a new instance of
optparse.Values by default)

Cheers, Michael
msg26921 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-11-26 16:37
Logged In: YES 
user_id=1188172

Assigning to Greg as he maintains the upstream Optik
distribution.
msg26922 - (view) Author: Greg Ward (gward) (Python committer) Date: 2006-06-11 14:43
Logged In: YES 
user_id=14422

Actually, I prefer the terminology in the example code, and
think that the text is wrong.  So I fixed the text instead.
 Also made a few other small tweaks to this section.

Fixed upstream in Optik svn, rev 519.
Fix on Python trunk, rev 46860.
History
Date User Action Args
2022-04-11 14:56:14adminsetgithub: 42624
2005-11-25 12:22:29popuptoastercreate