class A(object):
    def __get(self):
        pass
    def _m(self):
        return self.__get()
class B(A):
    def _m(self):
        return str(self.__get())
print(A()._m())
print(B()._m())
Why print(A()._m()) prints None, but print(B()._m()) raises AttributeError: 'B' object has no attribute '_B__get'?
I thought that double underscore prevents method overriding.
If __get is private then why does the following work?
class A(object):
    def __get(self):
        pass
    def _m(self):
        return self.__get()
class B(A):
    pass
print(A()._m())
print(B()._m())
Why does this code doesn't raise AttributeError and prints None two times?
 
     
     
     
    