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

SourceForge.net noreply at sourceforge.net
Tue Jul 25 06:06:28 CEST 2006


Bugs item #1518621, was opened at 2006-07-07 02:35
Message generated for change (Settings changed) made by nnorwitz
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: Greg Ward (gward)
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)

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

>Comment By: Neal Norwitz (nnorwitz)
Date: 2006-07-24 21:06

Message:
Logged In: YES 
user_id=33168

Greg, are you using the Python tracker or only optik tracker?

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

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