amaranth/amaranth/asserts.py
Wanda bfe541a6d7 Implement RFC 50: Print and string formatting.
Co-authored-by: Catherine <whitequark@whitequark.org>
2024-03-11 09:42:43 +00:00

15 lines
570 B
Python

from .hdl._ast import AnyConst, AnySeq, Initial
from . import hdl as __hdl
__all__ = ["AnyConst", "AnySeq", "Initial", "Assert", "Assume", "Cover"]
def __getattr__(name):
import warnings
if name in __hdl.__dict__ and name in __all__:
if not (name.startswith("__") and name.endswith("__")):
warnings.warn(f"instead of `{__name__}.{name}`, use `{__hdl.__name__}.{name}`",
DeprecationWarning, stacklevel=2)
return getattr(__hdl, name)
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")