summaryrefslogtreecommitdiff
path: root/numpy/f2py/symbolic.py
diff options
context:
space:
mode:
authorPearu Peterson <pearu.peterson@gmail.com>2021-09-01 22:54:12 +0300
committerPearu Peterson <pearu.peterson@gmail.com>2021-09-01 22:54:12 +0300
commitd880dce560fd6369d7418ba83c03cc5947993103 (patch)
tree31b9866922b6440fe65d688c7d16af3bfae9bed5 /numpy/f2py/symbolic.py
parent26752c3ad454f72a94cc7db32ccba43a76a85a5e (diff)
downloadnumpy-d880dce560fd6369d7418ba83c03cc5947993103.tar.gz
Fix bugs and warnings from LGTM report
Diffstat (limited to 'numpy/f2py/symbolic.py')
-rw-r--r--numpy/f2py/symbolic.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/numpy/f2py/symbolic.py b/numpy/f2py/symbolic.py
index f0b1da288..56faa309c 100644
--- a/numpy/f2py/symbolic.py
+++ b/numpy/f2py/symbolic.py
@@ -205,6 +205,12 @@ class Expr:
return self.data < other.data
return NotImplemented
+ def __le__(self, other): return self == other or self < other
+
+ def __gt__(self, other): return not (self <= other)
+
+ def __ge__(self, other): return not (self < other)
+
def __repr__(self):
return f'{type(self).__name__}({self.op}, {self.data!r})'
@@ -354,7 +360,7 @@ class Expr:
return normalize(r)
if self.op is Op.COMPLEX and other.op in (Op.INTEGER, Op.REAL):
return self + as_complex(other)
- elif self.op is (Op.INTEGER, Op.REAL) and other.op is Op.COMPLEX:
+ elif self.op in (Op.INTEGER, Op.REAL) and other.op is Op.COMPLEX:
return as_complex(self) + other
elif self.op is Op.REAL and other.op is Op.INTEGER:
return self + as_real(other, kind=self.data[1])