title: Object cannot be created globally but can locally python
body: <p>I am defining two classes in the same module and want to use the second one in the first one (as a global variable):</p>
  
  <pre><code>class Class1(object):
      global_c2 = Class2()
  
      def foo(self):
          local_c2 = Class2()
  
  class Class2(object):
      pass
  </code></pre>
  
  <p>global_c2 gets an error but local_c2 doesn't. This makes sense because when the compiler looks through this file it won't know that Class2 is going to exist. Also if I switch the class around so that Class2 is defined first it works.</p>
  
  <p>However I was wondering if there is another way to get around this. Maybe I can somehow tell python that Class2 is going to exist so don't worry about it, or do I just have to put them in the right order?</p>