hdl._nir: Add empty __slots__ to Net and Value.

This commit is contained in:
Wanda 2024-02-29 19:49:04 +01:00 committed by Catherine
parent f8e2d26b8f
commit 3271f85650

View file

@ -21,6 +21,8 @@ __all__ = [
class Net(int):
__slots__ = ()
@classmethod
def from_cell(cls, cell: int, bit: int):
assert bit in range(1 << 16)
@ -83,6 +85,8 @@ class Net(int):
class Value(tuple):
__slots__ = ()
def __new__(cls, nets: 'Net | Iterable[Net]' = ()):
if isinstance(nets, Net):
return super().__new__(cls, (nets,))