call f(a, *b) with f(*a, **b) ?
inhahe
inhahe at gmail.com
Fri May 23 06:29:14 EDT 2008
"inhahe" <inhahe at gmail.com> wrote in message
news:MKwZj.2749$772.668 at bignews2.bellsouth.net...
> if we assume the constraints are that:
> 1.he has list, l
> 2.he has a dictionary, d
> 3.he wants the function to print the values in the dictionary according to
> a specific order of their keys as defined by the function, followed by the
> values of the list
It's also possible (even likely) that he knows outside of the function what
order he wants the values in, and only used an (incidentally) unordered dict
called kwargs because he thought that's the only way to pass to those
parameters. in which case the function could be left untouched and the he
would call it like this:
args = [1,2,3]
f(*args)
or
f(*[1,2,3])
More information about the Python-list
mailing list