hdl.ast: implement Value.__pos__.

This commit is contained in:
Catherine 2023-02-27 22:31:17 +00:00
parent 342fd5f8bd
commit bef2052c1e
2 changed files with 6 additions and 0 deletions

View file

@ -166,6 +166,9 @@ class Value(metaclass=ABCMeta):
def __bool__(self):
raise TypeError("Attempted to convert Amaranth value to Python boolean")
def __pos__(self):
return self
def __invert__(self):
return Operator("~", [self])
def __neg__(self):