MCPcopy Create free account
hub / github.com/numpy/numpy / __lt__

Method __lt__

numpy/f2py/symbolic.py:249–262  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

247 return hash((self.op, data))
248
249 def __lt__(self, other):
250 if isinstance(other, Expr):
251 if self.op is not other.op:
252 return self.op.value < other.op.value
253 if self.op in (Op.TERMS, Op.FACTORS):
254 return (tuple(sorted(self.data.items()))
255 < tuple(sorted(other.data.items())))
256 if self.op is Op.APPLY:
257 if self.data[:2] != other.data[:2]:
258 return self.data[:2] < other.data[:2]
259 return tuple(sorted(self.data[2].items())) < tuple(
260 sorted(other.data[2].items()))
261 return self.data < other.data
262 return NotImplemented
263
264 def __le__(self, other): return self == other or self < other
265

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected