INNER CODE UNIT · Python

__getattr__

g-battaglia/kerykeion · kerykeion/__init__.py:395

def __getattr__(name: str):
    # ImportError (not AttributeError) so that `from kerykeion import AstrologicalSubject`
    # surfaces this message verbatim instead of Python's generic "cannot import name".
    # Trade-off: hasattr()/getattr(..., default) also raise for these names —
    # feature-detect with try/except ImportError instead.
    if name in _V5_REMOVED_NAMES:
        raise ImportError(
            f"{_V5_REMOVED_NAMES[name]}{_BEHAVIOUR_CHANGES_NOTE}"
            f"\nMigration guide: {_MIGRATION_GUIDE_URL}"
        )
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…