Re: Passing variable number of named arguments

2006-12-27 Thread Ramashish Baranwal
Carsten Haese wrote: > On Wed, 2006-12-27 at 10:37 -0800, Ramashish Baranwal wrote: > >[...] > > def fun2(**kwargs): > > # get id param > > id = kwargs.pop('id', '') > > # pass on remaining to fun1 > > fun1(kwargs) > > > > When I try to call fun2 I get the following error- > > > > T

Re: Passing variable number of named arguments

2006-12-27 Thread Carsten Haese
On Wed, 2006-12-27 at 10:37 -0800, Ramashish Baranwal wrote: >[...] > def fun2(**kwargs): > # get id param > id = kwargs.pop('id', '') > # pass on remaining to fun1 > fun1(kwargs) > > When I try to call fun2 I get the following error- > > TypeError: fun1() takes exactly 0 argument

Passing variable number of named arguments

2006-12-27 Thread Ramashish Baranwal
Hi, I need to process few out of a variable number of named arguments in a function and pass the remaining to another function that also takes variable number of named arguments. Consider this simple example, def fun1(**kwargs): print kwargs.keys() def fun2(**kwargs): # get id param