I was watching a Python talk at Youtube and found an interesting language feature. However when I tried to run a test code it didn't work and I'd like to understand why.
I was expecting this to print this:
Parent
OtherParent
But instead I got this:
Parent
Parent
Sample code:
class Parent:
def get_message(self):
return "Parent"
class Child(Parent):
def do_print(self):
print(super().get_message())
class OtherParent:
def get_message(self):
return "OtherParent"
class OtherChild(Child, OtherParent):
pass
Child().do_print()
OtherChild().do_print()
Edit: Running on Windows, Python 3.5.1, Anaconda 4.0.0 (64-bit)