It doesn't support file paths. It does support package names, but it doesn't really do what you expect: __import__('X.Y.Z') will indeed import the X, X.Y, and X.Y.Z modules and install them in sys.modules, but the function returns the X package module instead of the Z module.
It doesn't support file paths. It does support package names, but it doesn't really do what you expect: __import__('X.Y.Z') will indeed import the X, X.Y, and X.Y.Z modules and install them in sys.modules, but the function returns the X package module instead of the Z module.
Also see: http://effbot.org/zone/import-string.htm
"The Module Documentation Tells You To Use from-import"
Examples of this would include everything in __future__.