INNER CODE UNIT · Python

__getattr__

QianyeSu/Skyborn · src/skyborn/calc/__init__.py:158

def __getattr__(name: str) -> Any:
    """Resolve calculation package compatibility exports on first access."""

    if name in _SUBMODULE_EXPORTS:
        module = import_module(f"{__name__}.{name}")
        globals()[name] = module
        return module

    if name in _OBJECT_EXPORTS:
        module_name, object_name = _OBJECT_EXPORTS[name]
        value = getattr(import_module(module_name), object_name)
        globals()[name] = value
        return value

    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")


def __dir__() -> list[str]:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…