title: why is subclass accessing superclass' attribute inspite of having its own attribute of same name when that attribute is declared private?
body: <p>I have a parent class <strong>Animal</strong> and child class <strong>Dog</strong>. I wanted to create 1 instance of each and print the their <em>count</em>. Here is the working code:</p>
  
  <pre><code>class Animal:
    count=0
    def __init__(self):
       Animal.count+=1
    @classmethod
    def getCount(cls):
       return cls.count
  
  class Dog (Animal):
    count=0
    def __init__(self):
      super().__init__()
      Dog.count+=1
  
   a1=Animal()
   print(Animal.getCount(),Dog.getCount())
   d1=Dog()
   print(Animal.getCount(),Dog.getCount())
  </code></pre>
  
  <p>It prints:<br> 
  1 0<br>
  2 1<br>
  <br>
  which is correct as there are 2 animals but only 1 of them is dog.<br><br>
  The problem occurs when i create <em>count</em> variable as private <em>__count</em> without changing any other piece of code.</p>
  
  <pre><code>class Animal:
    __count=0
    def __init__(self):
      Animal.__count+=1
    @classmethod
    def getCount(cls):
      return cls.__count
  
  class Dog (Animal):
    __count=0
    def __init__(self):
      super().__init__()
      Dog.__count+=1
  
  a1=Animal()
  print(Animal.getCount(),Dog.getCount())
  d1=Dog()
  print(Animal.getCount(),Dog.getCount())
  </code></pre>
  
  <p><br><br>
  Now, it prints:<br> 
  1 1<br>
  2 2<br>
  <br>
  Seems like <strong>Dog</strong> class is only accessing the <strong>Animal's</strong> <em>__count</em>.<br> <strong>Can you detect  the bug in the code?</strong></p>