We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
flipped(flipped(intf)) is intf
1 parent 5a17f94 commit f28b20fCopy full SHA for f28b20f
amaranth/lib/wiring.py
@@ -552,7 +552,10 @@ def __repr__(self):
552
553
554
def flipped(interface):
555
- return FlippedInterface(interface)
+ if type(interface) is FlippedInterface:
556
+ return interface._FlippedInterface__unflipped
557
+ else:
558
+ return FlippedInterface(interface)
559
560
561
@final
tests/test_lib_wiring.py
@@ -530,6 +530,7 @@ def test_basic(self):
530
self.assertEqual(tintf, flipped(intf))
531
self.assertRegex(repr(tintf),
532
r"^flipped\(<.+?\.Interface object at .+>\)$")
533
+ self.assertIs(flipped(tintf), intf)
534
535
def test_getattr_setattr(self):
536
class I(Interface):
0 commit comments