以下关于Python多继承的语法,正确的是
class Child(Parent1, Parent2):
class Child extends Parent1, Parent2:
class Child inherits Parent1, Parent2:
class Child(Parent1).(Parent2):
在Python中,如果一个子类同时继承了两个父类,并且这两个父类有同名方法,那么通过子类实例调用该方法时,Python会如何决定使用哪个父类的方法?
总是使用第一个父类的方法
总是使用第二个父类的方法
按MRO(方法解析顺序)
随机选择一个父类的方法