So super(A, c) refers to the baseclass object?

I don't like this. It partially suggests that A is a superclass of B.
I guess I have to be sure to notice the second parameter which tells of 
which instance I'm finding the superclass.

fyi I totally didn't notice the first parameter of super... was it there in 
previous versions of python?


----- Original Message ----- 
From: "Andreas Kostyrka" <[EMAIL PROTECTED]>
To: "tiger12506" <[EMAIL PROTECTED]>
Cc: <tutor@python.org>
Sent: Friday, March 21, 2008 4:25 AM
Subject: Re: [Tutor] Calling super classs __init__?

class A(object):
    v=lambda self: "A"
class B(object):
    v=lambda self: "B"
class C(B,A):
    v=lambda self: "C"

print C.__mro__

c=C()
print c.v()
print super(C, c).v()
print super(B, c).v()

(<class '__main__.C'>, <class '__main__.B'>, <class '__main__.A'>, <type 
'object'>)
C
B
A 
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to