loki.types.module_type

Representation of a module type for module definitions.

Classes

ModuleType([name, module])

Representation of a module definition.

class ModuleType(name=None, module=None)

Bases: DataType

Representation of a module definition.

This serves as a caching mechanism for module definitions in symbol tables.

Parameters:
  • name (str, optional) – The name of the module. Can be skipped if module is provided (not in the form of a LazyNodeLookup)

  • module (Module LazyNodeLookup, optional) – The procedure this type represents

property name

The name of the module

This looks up the name in the linked module if available, otherwise returns the name stored during instantiation of the ModuleType object.

property module

The Module object represented by this type

If not provided during instantiation or if the underlying weakref is dead, this returns BasicType.DEFERRED.