title: Having Trouble with Inner Classes
body: <p>I am having trouble getting my small program to work while using an inner class.
  When, I set a inside class member variable from the outside class, the value does not stick. Thanks.</p>
  
  <p>Here is my source code:</p>
  
  <pre><code>class Erik:
  
      def __init__(self):
  
          self.__myData = self.Data()
  
  
      class Data:
          def __init__(self):
  
              self.__privateNumber = 0
  
          def getNumber(self):
              return self.__privateNumber
  
      def getData(self):
          return self.__myData
  
  
      def fun(self):
  
          self.__myData.__privateNumber = 64
  
          print 'Private Number Inside:', self.__myData.__privateNumber
  
  
  myErik = Erik()
  
  print 'Having fun...'
  myErik.fun()
  
  # This print statement should output '64'
  print 'Private Number Outside:', myErik.getData().getNumber()
  </code></pre>
  
  <p>This is the output of my script:</p>
  
  <pre><code>C:\Users\Erik\Desktop\PYTHON_TINKER_DEALS&gt;python erik.py
  Having fun...
  Private Number Inside: 64
  Private Number Outside: 0
  </code></pre>
  
  <p>As you see, when I set the private number to 64, it does not reflect that when you get the data from the outer class.
  Thanks.</p>