hdl.ast: remove Shape<>tuple comparisons.

See #691.

I missed this in commit 29502442.
This commit is contained in:
Catherine 2023-01-31 15:23:06 +00:00
parent f133646e9b
commit 7044e09110
4 changed files with 82 additions and 92 deletions

View file

@ -116,15 +116,6 @@ class Shape:
return "unsigned({})".format(self.width)
def __eq__(self, other):
# TODO(nmigen-0.4): remove
if isinstance(other, tuple) and len(other) == 2:
width, signed = other
if isinstance(width, int) and isinstance(signed, bool):
return self.width == width and self.signed == signed
else:
raise TypeError("Shapes may be compared with other Shapes and (int, bool) tuples, "
"not {!r}"
.format(other))
if not isinstance(other, Shape):
try:
other = self.__class__.cast(other)