Re: arguments of a function/metaclass

2007-01-18 Thread rubbishemail
thank you! -- http://mail.python.org/mailman/listinfo/python-list

Re: arguments of a function/metaclass

2007-01-16 Thread goodwolf
[EMAIL PROTECTED] je napisao/la: > Hello, > > > I have a member function with many (20) named arguments > > def __init__(self,a=1,b=2): > self.a=a > self.b=b > > I would like to get rid of the many redundant lines like self.a=a and > set the members automatically. > The list of default arg

Re: arguments of a function/metaclass

2007-01-16 Thread goodwolf
Gabriel Genellina je napisao/la: > "goodwolf" <[EMAIL PROTECTED]> escribió en el mensaje > news:[EMAIL PROTECTED] > > A simply solution: > > > > def __init__(self, a=1, b=2, c=3, ..): > >for key, val in locals().items(): > >if key != 'self': > >setattr(self.__class__, k

Re: arguments of a function/metaclass

2007-01-16 Thread Gabriel Genellina
"goodwolf" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > A simply solution: > > def __init__(self, a=1, b=2, c=3, ..): >for key, val in locals().items(): >if key != 'self': >setattr(self.__class__, key, val) > > in addition: > > def set(self, **kwa

Re: arguments of a function/metaclass

2007-01-16 Thread goodwolf
[EMAIL PROTECTED] je napisao/la: > Hello, > > > I have a member function with many (20) named arguments > > def __init__(self,a=1,b=2): > self.a=a > self.b=b > > I would like to get rid of the many redundant lines like self.a=a and > set the members automatically. > The list of default arg

Re: arguments of a function/metaclass

2007-01-16 Thread Stargaming
[EMAIL PROTECTED] schrieb: > Hello, > > > I have a member function with many (20) named arguments > > def __init__(self,a=1,b=2): > self.a=a > self.b=b > > I would like to get rid of the many redundant lines like self.a=a and > set the members automatically. > The list of default argume

Re: arguments of a function/metaclass

2007-01-16 Thread Michele Simionato
[EMAIL PROTECTED] wrote: > Hello, > > > I have a member function with many (20) named arguments > > def __init__(self,a=1,b=2): > self.a=a > self.b=b > > I would like to get rid of the many redundant lines like self.a=a and > set the members automatically. > The list of default arguments co

arguments of a function/metaclass

2007-01-16 Thread rubbishemail
Hello, I have a member function with many (20) named arguments def __init__(self,a=1,b=2): self.a=a self.b=b I would like to get rid of the many redundant lines like self.a=a and set the members automatically. The list of default arguments could be given like def __init__(**kwargs):