I have this code:
class B:
def __init__(self):
self._name = "name in B"
def printName(self):
print(self._name)
class D(B):
def __init__(self):
super().__init__()
self._name = "name in D"
o = D()
print(o._name)
o.printName()
Result:
name in D
name in D
I can override a "private" attribute in B (and this is a problem), so if I want to use class B I must know its private attribute to avoid this issue. But I think that who uses a class nust not to know its private attribute beacuse OOP wants information hiding, further a programmer would be limited to choose the name of attribute in derived class.