[issue8979] OptParse __getitem__

Bryan Ward report at bugs.python.org
Sat Jun 12 03:04:24 CEST 2010


New submission from Bryan Ward <bward1 at gmail.com>:

It would be convenient to be able to access the resultant options from optparse using the syntax

options['some_option']

instead of options.some_option

Or additionally it would be nice to have a way to produce a dictionary of the options.  This would be nice to have to do something to the effect of

dictOptions = options.to_dict()

obj = SomeObject(**dictOptions)

----------
components: Extension Modules
messages: 107620
nosy: bcward
priority: normal
severity: normal
status: open
title: OptParse __getitem__
type: feature request
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8979>
_______________________________________


More information about the Python-bugs-list mailing list