about the order of Class in python

#!/usr/bin/python2 class A(object): print ‘in A class…’ def __init__(self): print ‘-‘ * 20 print ‘init ‘, self.__class__.__name__,’ calss…’ print ‘Created Class:’, self.__class__.__name__ print ‘out ‘, self.__class__.__name__,’A calss…’ print ‘-‘ * 20 print ‘out A class…’ class B(A): print ‘in B class…’ class C(B): print ‘in B class…’ class D(B, A): print ‘in D class…’ a […]

fun for class

Structure: #!/usr/bin/python2 class A(object): def __init__(self): print ‘Created Class:’, self.__class__.__name__ print ‘in A class…’ class B(A): print ‘in B class…’ class C(A): print ‘in C class…’ class D(B): print ‘in D class…’ class E(B): print ‘in E class…’ class F(C): print ‘in F class…’ class H(D): print ‘in H class…’ class G(E,F): print ‘in G […]

关于python的class

复杂的类继承关系 #!/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__() […]