code1:
class base(object):
def test(self):
pass
class low1(object):
def test(self):
super(low1, self).test()
print "low1 test"
class low2(object):
def test(self):
super(low2, self).test()
print "low2 test"
class high(low1, low2, base):
pass
if __name__ == "__main__":
high().test()
code2:
class base(object):
def test(self):
pass
class low1(object):
def test(self):
# super(low1, self).test()
print "low1 test"
class low2(object):
def test(self):
# super(low2, self).test()
print "low2 test"
class high(low1, low2, base):
pass
if __name__ == "__main__":
high().test()
the output of code1 is:
low2 test
low1 test
the output of code2 is:
low1 test
when I call why test method of a high object, it execute test method of both low1 and low2?