本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《
  
   阿里云开发者社区用户服务协议
  
  》和
        《
  
   阿里云开发者社区知识产权保护指引
  
  》。如果您发现本社区中有涉嫌抄袭的内容,填写
  
   侵权投诉表单
  
  进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
  
   但是如果Parent_2是QObject或QObject的子孙类,
  
  
   在Child的中__init__()中执行QObject.__init__(self)
  
  
   则会使Parent_3.__init__(self)被执行
  
  
   原因不明。。。。。。。。。
  
  from PyQt5.QtCore import  QObject
class Parent_1:
    def __init__(self):
        print('Parent_1.__init__')
class Parent_2(Parent_1):
    def __init__(self):
        super(Parent_2, self).__init__()
        print('Parent_2.__init__')
class Parent_3:
    def __init__(self):
        print('Parent_3.__init__')      
class Child_2( QObject , Parent_2,Parent_3):
        def __init__(self):
            #QObject.__init__(self) 
            super(QObject, self).__init__()
            #super(Child_2, self).__init__()
if __name__ == '__main__': 
    import sys
    from PyQt5.QtWidgets import QApplication
    app = QApplication(sys.argv)  
 #####################################################   
    print('---------------------------')
    child_2 =     Child_2()    
  #####################################################   
    sys.exit(app.exec_())
 输出结果为: