lib.wiring: use is for type comparison in Component.

This avoids running custom `__eq__` implementations, which could
cause issues such as #882.
This commit is contained in:
Catherine 2023-08-31 19:19:38 +00:00
parent 44d5fac01c
commit 88cbf30128

View file

@ -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):