复杂的类继承关系

#!/usr/bin/python2

class A(object):

def \_\_init\_\_(self):

        print "enter A"

        super(A, self).\_\_init\_\_()  # new

        print "leave A"

class B(object):

def \_\_init\_\_(self):

    print "enter B"

    super(B, self).\_\_init\_\_()  # new

    print "leave B"

class C(A):

def \_\_init\_\_(self):

    print "enter C"

    super(C, self).\_\_init\_\_()

    print "leave C"

class D(A):

def \_\_init\_\_(self):

    print "enter D"

    super(D, self).\_\_init\_\_()

    print "leave D"

class E(B, C):

def \_\_init\_\_(self):

    print "enter E"

    super(E, self).\_\_init\_\_()  # change

    print "leave E"

class F(E, D):

def \_\_init\_\_(self):

    print "enter F"

    super(F, self).\_\_init\_\_()  # change

    print "leave F"

f = F()