I am reading python 3.7 documentation. And I am very confused about the following sentences:
"Derived classes may override methods of their base classes. Because methods have no special privileges when calling other methods of the same object, a method of a base class that calls another method defined in the same base class may end up calling a method of a derived class that overrides it. (For C++ programmers: all methods in Python are effectively virtual.)"
Can you show me an example code that "a base class that calls another method defined in the same base class may end up calling a method of a derived class that overrides it."? And here is my understanding:
class A:
def me(self):
print("This is A")
def idet(self):
self.me()
class B(A):
def me(self):
print("this is B")
a = A()
b = B()
b.me()
b.idet()
the result is
this is B
this is B
I am not sure if it is the case.
And the last question is what does "all methods in Python are effectively virtual" mean? (I am familiar with Java but not C++)