Inheritance of private and protected methods in Python
问题 I know, there are no \'real\' private/protected methods in Python. This approach isn\'t meant to hide anything; I just want to understand what Python does. class Parent(object): def _protected(self): pass def __private(self): pass class Child(Parent): def foo(self): self._protected() # This works def bar(self): self.__private() # This doesn\'t work, I get a AttributeError: # \'Child\' object has no attribute \'_Child__private\' So, does this behaviour mean, that \'protected\' methods will be