From 3271f85650653d61b987754a1ba4a3c34fa110c9 Mon Sep 17 00:00:00 2001 From: Wanda Date: Thu, 29 Feb 2024 19:49:04 +0100 Subject: [PATCH] hdl._nir: Add empty `__slots__` to `Net` and `Value`. --- amaranth/hdl/_nir.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/amaranth/hdl/_nir.py b/amaranth/hdl/_nir.py index 264b317..6e5aee1 100644 --- a/amaranth/hdl/_nir.py +++ b/amaranth/hdl/_nir.py @@ -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,))