Skip to content

ModuleData

Contains all data collected for a module.

Attributes:

Name Type Description
scope Scope

The module's scope, this contains all child scopes.

classes dict[str, ClassScope]

All classes and their ClassScope.

functions dict[str, list[FunctionScope]]

All functions and a list of their FunctionScopes. The value is a list since there can be multiple functions with the same name.

imports dict[str, Import]

All imported symbols.

Source code in src/library_analyzer/processing/api/purity_analysis/model/_module_data.py
@dataclass
class ModuleData:
    """
    Contains all data collected for a module.

    Attributes
    ----------
    scope :
        The module's scope, this contains all child scopes.
    classes :
        All classes and their ClassScope.
    functions :
        All functions and a list of their FunctionScopes.
        The value is a list since there can be multiple functions with the same name.
    imports :
        All imported symbols.
    """

    scope: Scope
    classes: dict[str, ClassScope]
    functions: dict[str, list[FunctionScope]]
    imports: dict[str, Import]

classes: dict[str, ClassScope] instance-attribute

functions: dict[str, list[FunctionScope]] instance-attribute

imports: dict[str, Import] instance-attribute

scope: Scope instance-attribute

__init__(scope, classes, functions, imports)