title: Nested classes' scope?
body: <p>I'm trying to understand scope in nested classes in Python. Here is my example code:</p>
  
  <pre><code>class OuterClass:
      outer_var = 1
      class InnerClass:
          inner_var = outer_var
  </code></pre>
  
  <p>The creation of class does not complete and I get the error:</p>
  
  <pre class="lang-none prettyprint-override"><code>&lt;type 'exceptions.NameError'&gt;: name 'outer_var' is not defined
  </code></pre>
  
  <p>Trying <code>inner_var = Outerclass.outer_var</code> doesn't work.
  I get:</p>
  
  <pre class="lang-none prettyprint-override"><code>&lt;type 'exceptions.NameError'&gt;: name 'OuterClass' is not defined
  </code></pre>
  
  <p>I am trying to access the static <code>outer_var</code> from <code>InnerClass</code>.</p>
  
  <p>Is there a way to do this?</p>