LazyModule

digraph inheritancefc01df6fdc { bgcolor=transparent; rankdir=UD; ratio=compress; size="8.0, 12.0"; "LazyModule" [URL="#taurus.core.util.lazymodule.LazyModule",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="It provides a ModuleType object that acts as a placeholder for modules"]; "module" -> "LazyModule" [arrowsize=0.5,style="setlinewidth(0.5)"]; "module" [color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="Create a module object."]; }
class LazyModule(name, package, entry_point)[source]

It provides a ModuleType object that acts as a placeholder for modules registered via entry-points. It replaces the actual module without actually importing it until a member of the module is requested, which automatically triggers the load of the entry-point and the substitution of this placeholder by the actual module

Import from taurus.core.util.lazymodule as:

from taurus.core.util.lazymodule import LazyModule
static import_ep(name, package, entry_point)[source]

Lazily imports a module defined in an entry point. The LazyModule is inserted in sys.modules as <package>.<name>

Parameters:
  • name – name of the module

  • package – name of the package to which the module belongs

  • entry_point – entry-point for a module

Returns:

A LazyModule object