friendlysam.opt.Less

class friendlysam.opt.Less

The relation “less than”.

Examples

>>> x = Variable('x')
>>> expr = (x < 1)
>>> expr
<friendlysam.opt.Less at 0x...>
>>> expr == Less(x, 1)
True
>>> x.value = 1
>>> expr.value
False

Note

There is no Greater class, but you can use the overloaded operator >.

>>> x > 1
<friendlysam.opt.Less at 0x...>
>>> print(_)
1 < x
>>> (x > 1) == (1 < x)
True
Less.create(*args) Classmethod to create a new object.
Less.evaluate([replace, evaluators]) Evaluate the expression recursively.
Less.args This property holds the arguments of the operation.
Less.leaves The leaves of the expression tree.
Less.value The concrete value of the expression, if possible.
Less.variables This property gives all leaves which are instances of Variable.