class LazyLoader(local_name, parent_module_globals, name)[source]

Lazily import a module, mainly to avoid pulling in large dependencies.

This class acts as a proxy for a module, loading it only when an attribute of the module is accessed for the first time.

  • local_name – The local name that the module will be refered to as.

  • parent_module_globals – The globals of the module where this should be imported. Typically this will be globals().

  • name – The full qualified name of the module.

__init__(local_name, parent_module_globals, name)[source]


__init__(local_name, parent_module_globals, name)