Re: using super() to call two parent classes __init__() method

2007-08-17 Thread Evan Klitzke
On 8/16/07, 7stud <[EMAIL PROTECTED]> wrote: > When I run the following code and call super() in the Base class's > __init__ () method, only one Parent's __init__() method is called. As the other posters have mentioned, each class needs to make a call to super. This is because the super call does

Re: using super() to call two parent classes __init__() method

2007-08-16 Thread Steve Holden
7stud wrote: > When I run the following code and call super() in the Base class's > __init__ () method, only one Parent's __init__() method is called. > > > class Parent1(object): > def __init__(self): > print "Parent1 init called." > self.x = 10 > > class Parent2(object): >

Re: using super() to call two parent classes __init__() method

2007-08-16 Thread Alex Martelli
7stud <[EMAIL PROTECTED]> wrote: > When I run the following code and call super() in the Base class's > __init__ () method, only one Parent's __init__() method is called. > > > class Parent1(object): > def __init__(self): > print "Parent1 init called." > self.x = 10 > > cla

using super() to call two parent classes __init__() method

2007-08-16 Thread 7stud
When I run the following code and call super() in the Base class's __init__ () method, only one Parent's __init__() method is called. class Parent1(object): def __init__(self): print "Parent1 init called." self.x = 10 class Parent2(object): def __init__(self): pr