mi

Eric J. Van der Velden ericjvandervelden at gmail.com
Wed Aug 11 15:45:07 EDT 2010


Hello,

I have these types,

class A:
        def __init__(s):
                super().__init__()
                print("A")
class B(A):
        def __init__(s):
                super().__init__()
                print("B")
class C(A):
        def __init__(s):
                super().__init__()
                print("C")
class D(B,C):
        def __init__(s):
                super().__init__()
                print("D")

If I do (in 3.1)
>>> d=D()
A
C
B
D

Why this order? I thought, first to D, then B, then A. He prints "A".
He comes back in B and prints "B". He goes to C. Then somehow he
doesn't go again to A. He prints "C". Then back to D and prints "D".

Thanks,

Eric J.



More information about the Python-list mailing list