optparse

Sébastien Boisgérault Sebastien.Boisgerault at gmail.com
Wed May 11 15:54:10 EDT 2005


Any idea why the 'options' object in

# optparse stuff
(options, args) = parser.parse_args()

is not/couldn't be a real dict ? Or why at least it
does not support dict's usual methods ?

The next move after a parse_args is often to call
a method 'do_stuff' with the args and options and
I'd like to use a call such as:

do_stuff(args, **options)

This function signature is handy if you also need
sometimes to call 'do_stuff' from the Python interpreter.

Cheers,

SB




More information about the Python-list mailing list