[Tutor] it is ok that object.__init__ gets called multiple times?
claxo
clazzt at arnet.com.ar
Wed Jun 11 22:05:05 CEST 2008
In the following code the __init__ for C would end calling two times object.__init__ .
Is this ok or I calling for trouble ?
To make explicit some context:
object is the std python object
super is not suposed to be used in any subclass
class A(object):
def __init__(self,**kwargs):
object.__init__(self,**kwargs)
self.m_a = kwargs['ka']
class B(object):
def __init__(self,**kwargs):
object.__init__(self,**kwargs)
self.m_b = kwargs['kb']
class C(A,B):
def __init__(self,**kwargs):
A.__init__(self,**kwargs)
B.__init__(self,**kwargs)
More information about the Tutor
mailing list