英文文档:
__import__
(name, globals=None, locals=None, fromlist=(), level=0)
This function is invoked by the import
statement. It can be replaced (by importing the builtins
module and assigning to builtins.__import__
) in order to change semantics of the import
statement, but doing so is strongly discouraged as it is