2005年07月03日 星期日 13:16
做了个测试,概念还是不很清楚 在mixin上用处应该比较大 class A1(object): def access(self,m): print '%s in A1'%(m) super(A1,self).access(m) class A2(object): def access(self,m): print '%s in A2'%(m) #super(A2,self).access(m) class A11(A1): def access(self,m): print '%s in A11'%(m) super(A11,self).access(m) class B1(A11,A2): def access(self,m): print '%s in B1'%(m) super(B1,self).access(m) B1().access('123') =============== D:\>python a1.py 123 in B1 123 in A11 123 in A1 123 in A2 -- my gmail:lihuimail(at)gmail.com
Zeuux © 2025
京ICP备05028076号