title: python nested classes
body: <p>First of all, here's my test code, I'm using python 3.2.x:</p>
  
  <pre><code>class account:
      def __init__(self):
          pass
  
      class bank:
          def __init__(self):
              self.balance = 100000
  
          def balance(self):
              self.balance
  
          def whitdraw(self, amount):
              self.balance -= amount
  
          def deposit(self, amount):
              self.balance += amount
  </code></pre>
  
  <p>when I do:</p>
  
  <pre><code>a = account()
  a.bank.balance
  </code></pre>
  
  <p>I expected to get the value of balance returned, instead I get the function "balance", why is this? It returns the value of balance when I do:</p>
  
  <pre><code>class bank:
      def __init__(self):
          self.balance = 100000
  
      def balance(self):
          self.balance
  
      def whitdraw(self, amount):
          self.balance -= amount
  
      def deposit(self, amount):
          self.balance += amount
  
  a = bank()
  a.balance
  </code></pre>
  
  <p>So I want to know why this is and it would be great if someone could come up with a way to give me the value of balance in the nested version.</p>