multiple inharitance super() question
- From: Alex Greif <alex.greif@xxxxxxxxx>
- Date: Mon, 14 Nov 2005 13:28:39 +0100
Hi,
Before 2.2 I could initialize multiple super classes like this:
class B(A,AA):
def __init__(self, args):
A.__init__(self,args)
AA.__init__(self,args)
Tutorials say that since python 2.2 superclasses should be initialized
with the super() construct.
class A(object):
def __init__(self, args):
...
class B(A):
def __init__(self, args):
super(B, self).__init__(args)
BUT what happens if B extends from A and AA like:
class A(object):
def __init__(self, args):
...
class AA(object):
def __init__(self, args):
...
class B(A,AA):
def __init__(self, args):
super(B, self).__init__(args)
How can I tell that B.__init__() should initialize A and AA?
Or is the new super() so clever to call A.__init__() and AA.__init__()
internally?
thanks,
Alex Greif
________________________________________
http://www.fotobuch-xxl.de/
.
- Follow-Ups:
- Re: multiple inharitance super() question
- From: Peter Otten
- Re: multiple inharitance super() question
- Prev by Date: problem with from win32com.client import Dispatch
- Next by Date: Re: multiple inharitance super() question
- Previous by thread: problem with from win32com.client import Dispatch
- Next by thread: Re: multiple inharitance super() question
- Index(es):