[ python-Bugs-1518621 ] optparse.parse_args() ret value seems to be a dict but isn't

SourceForge.net noreply at sourceforge.net
Fri Jul 7 11:35:22 CEST 2006


Bugs item #1518621, was opened at 2006-07-07 11:35
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1518621&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: rhunger (rhunger)
Assigned to: Nobody/Anonymous (nobody)
Summary: optparse.parse_args() ret value seems to be a dict but isn't

Initial Comment:
...
from optparse import OptionParser
parser = OptionParser()
...
(options, args) = parser.parse_args()
print options
...

options seems to be a dict but isn't. So it's not possible to use e.g.

print "Option 1: %(firstOption)s" % options

Here it's easy to use "options.firstOption" but with a larger number of program options it would be nice to be able to use "options" as a dict directly.

(patch attached)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1518621&group_id=5470


More information about the Python-bugs-list mailing list