add PartitionedSignal.__len__ override, redirects to self.sig len
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 29 Sep 2021 17:25:45 +0000 (18:25 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 29 Sep 2021 17:25:45 +0000 (18:25 +0100)
src/ieee754/part/partsig.py

index 6baca3adc1c487e9aa74198cb9bd07eb82c9e1ad..35487330ba342a3567d23a306b09525c00b5dc23 100644 (file)
@@ -85,6 +85,9 @@ class PartitionedSignal(UserValue):
         result.m = other.m
         return result
 
+    def __len__(self):
+        return len(self.sig)
+
     # nmigen-redirected constructs (Mux, Cat, Switch, Assign)
 
     def __Mux__(self, val1, val2):