Python OOO design multiple class
<p>I have parent &amp; a child class and trying to instantiate the child class to inherit the properties of parent class.</p>

<p>This code works perfectly well but want to know if there is anyway to keep the self.list1 to be private ie; if I declare self.__list1 then its not accessible by the child class.</p>

<p>Can I override the childclass method to keep the self.__list1 as private?</p>

<pre><code>class parent(object):
    def __init__(self,x,y):
        self.x = x
        self.y = y
        self.list1 = ['a','b','c']
        print('self.x',self.x)
        print('self.y',self.y)

class child(parent):
    def test(self):
        print('In child self.x',self.x)
        print('In child self.list1',self.list1)

class test(object):
    def __init__(self,x1,y1):
        self.x1 = x1
        self.y1 = y1

    def process(self):
        childobj = child(self.x1,self.y1)
        childobj.test()

        pass


def main():            
    testx = test(2,3)
    testx.process()
</code></pre>
