@@ -107,6 +107,36 @@ def __pow__(self, other: AstConvertible) -> OQPyBinaryExpression:
107
107
def __rpow__ (self , other : AstConvertible ) -> OQPyBinaryExpression :
108
108
return self ._to_binary ("**" , other , self )
109
109
110
+ def __lshift__ (self , other : AstConvertible ) -> OQPyBinaryExpression :
111
+ return self ._to_binary ("<<" , self , other )
112
+
113
+ def __rlshift__ (self , other : AstConvertible ) -> OQPyBinaryExpression :
114
+ return self ._to_binary ("<<" , other , self )
115
+
116
+ def __rshift__ (self , other : AstConvertible ) -> OQPyBinaryExpression :
117
+ return self ._to_binary (">>" , self , other )
118
+
119
+ def __rrshift__ (self , other : AstConvertible ) -> OQPyBinaryExpression :
120
+ return self ._to_binary (">>" , other , self )
121
+
122
+ def __and__ (self , other : AstConvertible ) -> OQPyBinaryExpression :
123
+ return self ._to_binary ("&" , self , other )
124
+
125
+ def __rand__ (self , other : AstConvertible ) -> OQPyBinaryExpression :
126
+ return self ._to_binary ("&" , other , self )
127
+
128
+ def __or__ (self , other : AstConvertible ) -> OQPyBinaryExpression :
129
+ return self ._to_binary ("|" , self , other )
130
+
131
+ def __ror__ (self , other : AstConvertible ) -> OQPyBinaryExpression :
132
+ return self ._to_binary ("|" , other , self )
133
+
134
+ def __xor__ (self , other : AstConvertible ) -> OQPyBinaryExpression :
135
+ return self ._to_binary ("^" , self , other )
136
+
137
+ def __rxor__ (self , other : AstConvertible ) -> OQPyBinaryExpression :
138
+ return self ._to_binary ("^" , other , self )
139
+
110
140
def __eq__ (self , other : AstConvertible ) -> OQPyBinaryExpression : # type: ignore[override]
111
141
return self ._to_binary ("==" , self , other )
112
142
@@ -125,6 +155,9 @@ def __ge__(self, other: AstConvertible) -> OQPyBinaryExpression:
125
155
def __le__ (self , other : AstConvertible ) -> OQPyBinaryExpression :
126
156
return self ._to_binary ("<=" , self , other )
127
157
158
+ def __invert__ (self ) -> OQPyUnaryExpression :
159
+ return self ._to_unary ("~" , self )
160
+
128
161
def __bool__ (self ) -> bool :
129
162
raise RuntimeError (
130
163
"OQPy expressions cannot be converted to bool. This can occur if you try to check "
0 commit comments