class importlib.abc.Loader  
An abstract base class for a loader. See PEP 302 for the exact definition for a loader. Loaders that wish to support resource reading should implement a get_resource_reader(fullname) method as specified by importlib.abc.ResourceReader.  Changed in version 3.7: Introduced the optional get_resource_reader() method.   
create_module(spec)  
A method that returns the module object to use when importing a module. This method may return None, indicating that default module creation semantics should take place.  New in version 3.4.   Changed in version 3.5: Starting in Python 3.6, this method will not be optional when exec_module() is defined.  
  
exec_module(module)  
An abstract method that executes the module in its own namespace when a module is imported or reloaded. The module should already be initialized when exec_module() is called. When this method exists, create_module() must be defined.  New in version 3.4.   Changed in version 3.6: create_module() must also be defined.  
  
load_module(fullname)  
A legacy method for loading a module. If the module cannot be loaded, ImportError is raised, otherwise the loaded module is returned. If the requested module already exists in sys.modules, that module should be used and reloaded. Otherwise the loader should create a new module and insert it into sys.modules before any loading begins, to prevent recursion from the import. If the loader inserted a module and the load fails, it must be removed by the loader from sys.modules; modules already in sys.modules before the loader began execution should be left alone (see importlib.util.module_for_loader()). The loader should set several attributes on the module. (Note that some of these attributes can change when a module is reloaded):  
 
__name__


The name of the module.    
 
__file__


The path to where the module data is stored (not set for built-in modules).    
 
__cached__


The path to where a compiled version of the module is/should be stored (not set when the attribute would be inappropriate).    
 
__path__


A list of strings specifying the search path within a package. This attribute is not set on modules.    
 
__package__


The fully-qualified name of the package under which the module was loaded as a submodule (or the empty string for top-level modules). For packages, it is the same as __name__. The importlib.util.module_for_loader() decorator can handle the details for __package__.    
 
__loader__


The loader used to load the module. The importlib.util.module_for_loader() decorator can handle the details for __package__.     When exec_module() is available then backwards-compatible functionality is provided.  Changed in version 3.4: Raise ImportError when called instead of NotImplementedError. Functionality provided when exec_module() is available.   Deprecated since version 3.4: The recommended API for loading a module is exec_module() (and create_module()). Loaders should implement it instead of load_module(). The import machinery takes care of all the other responsibilities of load_module() when exec_module() is implemented.  
  
module_repr(module)  
A legacy method which when implemented calculates and returns the given module’s repr, as a string. The module type’s default repr() will use the result of this method as appropriate.  New in version 3.3.   Changed in version 3.4: Made optional instead of an abstractmethod.   Deprecated since version 3.4: The import machinery now takes care of this automatically.