If I import a module defining a class of the same name belonging to a package, it is imported as a Class, not a Module because of the __init__.py of the parent package. See
I have one myfile.py file which contains one class MyClass
To import just do:
from myfile import MyClass
mc = MyClass()
To reload:
import sys
del sys.modules['myfile']
from myfile import MyClass
modifiedmc = MyClass()
This is very useful while building modules. one can put these inside a function and just call the function
def myreload():
import sys
del sys.modules['myfile']
from myfile import MyClass
modifiedmc = MyClass()
global mc
mc = modifiedmc