title: Python - reference inner class from other inner class
body: <p>I am trying to reference an inner class from another inner class. I have tried both :</p>
  
  <pre><code>class Foo(object):
  
    class A(object):
      pass
  
    class B(object):
      other = A
  </code></pre>
  
  <p>and</p>
  
  <pre><code>class Foo(object):
  
    class A(object):
      pass
  
    class B(object):
      other = Foo.A
  </code></pre>
  
  <p>with respective results:</p>
  
  <pre><code>Traceback (most recent call last):
    File "python", line 1, in &lt;module&gt;
    File "python", line 6, in Foo
    File "python", line 7, in B
  NameError: name 'A' is not defined
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Traceback (most recent call last):
    File "python", line 1, in &lt;module&gt;
    File "python", line 6, in Foo
    File "python", line 7, in B
  NameError: name 'Foo' is not defined
  </code></pre>
  
  <p>Is this possible?</p>