title: Does Python import statement also import dependencies automatically?
body: <p>I have the following file <code>app.py</code></p>
  
  <pre><code>class Baz():
      def __init__(self, num):
          self.a = num
          print self.a
  
  def foo(num):
      obj = Baz(num)
  </code></pre>
  
  <p>and the second file <code>main.py</code></p>
  
  <pre><code>from app import foo
  foo(10)
  </code></pre>
  
  <p>Running the file <code>python main.py</code> gives the correct output.</p>
  
  <p>Now in the second file, I'm just importing the function not the class, although successful execution of my function requires the class as well.</p>
  
  <p>When importing the function does Python automatically import everything else which is needed to run that function, or does it automatically search for the class in the current directory?</p>