From 88cbf3012898e1c42041eefa0ea4bba0d81942e9 Mon Sep 17 00:00:00 2001 From: Catherine Date: Thu, 31 Aug 2023 19:19:38 +0000 Subject: [PATCH] lib.wiring: use `is` for type comparison in `Component`. This avoids running custom `__eq__` implementations, which could cause issues such as #882. --- amaranth/lib/wiring.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amaranth/lib/wiring.py b/amaranth/lib/wiring.py index 67e480f..cc1977b 100644 --- a/amaranth/lib/wiring.py +++ b/amaranth/lib/wiring.py @@ -760,7 +760,7 @@ class Component(Elaboratable): for name, annot in getattr(base, "__annotations__", {}).items(): if name.startswith("_"): continue - if (annot in (Value, Signal, Const) or + if (annot is Value or annot is Signal or annot is Const or (isinstance(annot, type) and issubclass(annot, ValueCastable)) or isinstance(annot, Signature)): if isinstance(annot, type):