title: Why is my python function not defined, when it exists in the same file?
body: <p>I have a simple function, which I shall call <code>myFunction</code>. It takes two parameters, performs some calculations on them, and returns the result.</p>
  
  <p>I also have a class, <code>MyClass</code>, which has a constructor that has a header like this:</p>
  
  <pre><code>__init__(self, bar, fun=myFunction):
  </code></pre>
  
  <p>When I try to run anything in this class, I get the following error:</p>
  
  <pre><code>MyClass
      def __init__(self, bar, fun=myFunction):
  NameError: name 'myFunction' is not defined
  </code></pre>
  
  <p>If I remove this class, I can use myFun in the Python Shell, so what's the deal?</p>