I have the following file app.py
class Baz():
def __init__(self, num):
self.a = num
print self.a
def foo(num):
obj = Baz(num)
and the second file main.py
from app import foo
foo(10)
Running the file python main.py
gives the correct output.
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.
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?