title: Python -- calling a function in same file as a class from within an instance of that class?
body: <p>I have a file structured like this:</p>
  
  <pre><code>imports
  
  def myFunc(spam):
      etc
  
  class MyClass():
      def someMethod(self):
           myFunc(eggs)
  </code></pre>
  
  <p>I don't think this works as I understand that functions assume scope local to just that function.  How would I accomplish this?  It seems silly to import itself and then call imported.myFunc()</p>
  
  <p>In case there are those that need to know why -- this is a file called utilities and the class is Database that contains my database wrapper stuff.  Outside of it are utility functions.  I'd prefer to keep Database inside of utilities, if possible.</p>