From f487ba8f94dac9b63ae2c43b764e6ac0ca70abd4 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 7 Feb 2020 16:29:19 +0000 Subject: [PATCH] add shift operators TODO on partsig --- src/ieee754/part/partsig.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ieee754/part/partsig.py b/src/ieee754/part/partsig.py index 1eae4a14..cef3fed6 100644 --- a/src/ieee754/part/partsig.py +++ b/src/ieee754/part/partsig.py @@ -86,6 +86,15 @@ class PartitionedSignal: # binary ops that need partitioning + def __lshift__(self, other): + return Operator("<<", [self, other]) + def __rlshift__(self, other): + return Operator("<<", [other, self]) + def __rshift__(self, other): + return Operator(">>", [self, other]) + def __rrshift__(self, other): + return Operator(">>", [other, self]) + def __add__(self, other): shape = self.sig.shape() pa = PartitionedAdder(shape[0], self.partpoints) -- 2.30.2