src.dackar.contrib.lazy.lazy_loader

A LazyLoader class.

Classes

LazyLoader

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

Module Contents

class src.dackar.contrib.lazy.lazy_loader.LazyLoader(local_name, parent_module_globals, name)[source]

Bases: types.ModuleType

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

contrib, and ffmpeg are examples of modules that are large and not always needed, and this allows them to only be loaded when they are used.

_local_name[source]
_parent_module_globals[source]
_load()[source]

Load the module and insert it into the parent’s globals.

__getattr__(item)[source]
__dir__()[source]