thank you!
--
http://mail.python.org/mailman/listinfo/python-list
[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
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
"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
[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
[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
[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
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):