class documentation

Lazy module class.

Lazy modules are imported into the given namespaces whenever a non-special attribute (there are some attributes like __doc__ that class instances handle without calling __getattr__) is requested. The module is then registered under the given name in locals usually replacing the import wrapper instance. The import itself is done using globals as global namespace.

Example of creating a lazy load module:

ISO = LazyModule('ISO',locals(),globals())

Later, requesting an attribute from ISO will load the module automatically into the locals() namespace, overriding the LazyModule instance:

t = ISO.Week(1998,1,1)

Method __getattr__ Import the module on demand and get the attribute.
Method __init__ Create a LazyModule instance wrapping module name.
Method __repr__ Undocumented
Method __setattr__ Import the module on demand and set the attribute.
Instance Variable __name__ Undocumented
Method __lazymodule_import Import the module now.
Class Variable __lazymodule_loaded Undocumented
Instance Variable __lazymodule_globals Undocumented
Instance Variable __lazymodule_init Undocumented
Instance Variable __lazymodule_locals Undocumented
Instance Variable __lazymodule_name Undocumented
def __getattr__(self, name): (source)

Import the module on demand and get the attribute.

def __init__(self, name, locals, globals=None): (source)

Create a LazyModule instance wrapping module name.

The module will later on be registered in locals under the given module name.

globals is optional and defaults to locals.

def __repr__(self): (source)

Undocumented

def __setattr__(self, name, value): (source)

Import the module on demand and set the attribute.

__name__ = (source)

Undocumented

def __lazymodule_import(self): (source)

Import the module now.

__lazymodule_loaded: int = (source)

Undocumented

__lazymodule_globals = (source)

Undocumented

__lazymodule_init: int = (source)

Undocumented

__lazymodule_locals = (source)

Undocumented

__lazymodule_name = (source)

Undocumented