"""
查找实例的继承类树
Date:2019.5.14
"""
def classtree(cls,indent):
    print('.'*indent+cls.__name__)
    for supercls in cls.__bases__:
        classtree(supercls,indent+3)

def instancetree(instant):
    print('Tree of %s'%instant)
    classtree(instant.__class__,3)

def selftest():
    class A:    pass
    class B(A): pass 
    class C(A): pass
    class D(B,C):pass
    class E:    pass
    class F(D,E):pass
    instancetree(B())
    instancetree(F())

if __name__=='__main__':
        selftest()
