Here's the code:
class Person:
def __getInfo(self):
return "Person"
def printPerson(self):
print(self.__getInfo())
class Student(Person):
def __getInfo(self):
return "Student"
Person().printPerson() # output: person
Student().printPerson() # output: person
My question is why the "private" method of the second class (Student) is not invoked when the "public" method (printPerson()) is invoked? And why do they all invoke __getInfo() in the baseclass?