INNER CODE UNIT · Python
__getattr__
discopy/discopy · discopy/python/__init__.py:19
def __getattr__(name):
"""
The functions are imported on first use rather than with the package:
:mod:`multiplicative` imports :mod:`monoidal`, which imports :mod:`finset`.
"""
if name not in ("exp", "Ty", "Function"):
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
return getattr(import_module("discopy.python.multiplicative"), name)