Re: expanding dictionary to function arguments

2005-11-02 Thread Bengt Richter
On 1 Nov 2005 17:17:00 -0800, "Noah" <[EMAIL PROTECTED]> wrote: >I have a dictionary that I would like to expand to satisfy a >function's agument list. I can used the ** syntax to pass a dictionary, >but >this only works if each key in the dictionary matches an argument. >I cannot pass a dictionar

Re: expanding dictionary to function arguments

2005-11-02 Thread bruno at modulix
Noah wrote: > Bruno Desthuilliers a écrit : > >>Noah a écrit : >>If you have control over the API functions declarations, makes them so: >>def my_api_func(arg1='', arg2='whatever', **kwargs): >> code_here > > > Unfortunately I cannot change the API functions. > I should have mentioned that. Y

Re: expanding dictionary to function arguments

2005-11-02 Thread Noah
Bruno Desthuilliers a écrit : > Noah a écrit : > If you have control over the API functions declarations, makes them so: > def my_api_func(arg1='', arg2='whatever', **kwargs): >code_here Unfortunately I cannot change the API functions. I should have mentioned that. Yours, Noah -- http://ma

Re: expanding dictionary to function arguments

2005-11-02 Thread Bruno Desthuilliers
Noah a écrit : > I have a dictionary that I would like to expand to satisfy a > function's agument list. I can used the ** syntax to pass a dictionary, > but > this only works if each key in the dictionary matches an argument. > I cannot pass a dictionary that has more keys than the function has >