title: Using super() in nested classes
body: <p>Imagine this:</p>
  
  <pre><code>class A(object):
      class B(object):
          def __init__(self):
              super(B, self).__init__()
  </code></pre>
  
  <p>This creates an error:</p>
  
  <pre>
  NameError: global name B is not defined.
  </pre>
  
  <p>I've tried <code>A.B</code>, but then it says that <code>A</code> is not defined.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I've found the problem.</p>
  
  <p>I've had a class like this:</p>
  
  <pre><code>class A(object):
      class B(object):
          def __init__(self):
              super(B, self).__init__()
  
      someattribute = B()
  </code></pre>
  
  <p>In that scope, A isn't defined yet.</p>