title: NameError: global name 'thing' is not defined
body: <p>I don't think there is quite the need for the continued downvoting, I am just trying to learn here!</p>
  
  <p>One.py</p>
  
  <pre><code>from two import *
  
  ADooDah = Doodah()
  something = Thing(ADooDah)
  
  something.DoThis()
  something.DoThat
  something.DoAnother
  if (something.has_done_stuff() == True)
      self.SomeFunction
  </code></pre>
  
  <p>Two.py</p>
  
  <pre><code>class Thing(var):
      def __init__(self, var)
          self.SomeVar = var
  
      def has_done_stuff(self):
          while True:
              id, newMessage = SomeVar.get_next_message()
              if id == 0:
                  return true
              else:
                  return false
  </code></pre>
  
  <p>I get...</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\One.py", line 9, in &lt;module&gt;
      has_done_stuff = thing.HasDoneStuff()
  NameError: global name 'thing' is not defined
  </code></pre>
  
  <p>EDITS: The code was indeed peppered with errors. I was trying to show my situation rather than any real code. Rush typing causes foolish typing. Even I'm not that bad! Well, most of the time ;) .</p>
  
  <p>I hope the edits make it all make more sense and you fine people can stop focusing on the crazy syntax errors and explain a bit more about my scope (I assume) problem. I'm fairly new to Python/IronPython and the rules around implicit types and scoping I am still in the process of learning!</p>
  
  <p>I have solved my problem though. Thanks. It was fairly unrelated to the above as it turns out. </p>