Skip to content

Commit a9d0380

Browse files
committed
lib.io: add a deprecation warning on Pin.eq.
This will stop working once `Pin` is no longer inheriting from `Record`.
1 parent 1d3a620 commit a9d0380

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: amaranth/lib/io.py

+6
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,9 @@ def __init__(self, width, dir, *, xdr=0, name=None, src_loc_at=0):
130130
@property
131131
def signature(self):
132132
return _pin_signature(self.width, self.dir, self.xdr)
133+
134+
def eq(self, other):
135+
first_field, _, _ = next(iter(Pin(1, dir="o").layout))
136+
warnings.warn(f"`pin.eq(...)` is deprecated; use `pin.{first_field}.eq(...)` here",
137+
DeprecationWarning, stacklevel=2)
138+
return super().eq(other)

0 commit comments

Comments
 (0)