I have a question about python inherited class method, in the following code.
class B(object):
def test(self):
self.call()
def call(self):
print("Call from B")
if __name__ == "__main__":
b = B()
b.test()
from b import B
class C(B):
def call(self):
print("Call from C")
if __name__ == "__main__":
c = C()
c.test()
When I run this code, the result is
Call from C
The parent class method will call children's method. I want to know if it is an expected and stable behaviour? Because I also try the same logic in C++, it will print
Call from B