Commit 526ff04c by Ziheng Jiang Committed by Tianqi Chen

[PYTHON/API] Add compare and logic build-in op for Expr (#39)

* [PYTHON/API] Add compare and logic build-in op for Expr

* remove 'and', 'or'
parent 45597d00
......@@ -37,6 +37,24 @@ class ExprOp(object):
def __neg__(self):
return self.__mul__(-1)
def __lt__(self, other):
return _make.LT(self, other)
def __le__(self, other):
return _make.LE(self, other)
def __eq__(self, other):
return _make.EQ(self, other)
def __ne__(self, other):
return _make.NE(self, other)
def __gt__(self, other):
return _make.GT(self, other)
def __ge__(self, other):
return _make.GE(self, other)
class Expr(NodeBase, ExprOp):
pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment