Commit acbc9fb7 authored by Taddeus Kroes's avatar Taddeus Kroes

Added inequivalence operator to ExpressionBase.

parent db692be1
...@@ -105,3 +105,5 @@ Division of 0 by 1 reduces to 0. ...@@ -105,3 +105,5 @@ Division of 0 by 1 reduces to 0.
- Line generator: 'der(f(x), x)' -> 'd/dx f(x)' - Line generator: 'der(f(x), x)' -> 'd/dx f(x)'
- Create unit tests for parser preprocessor. - Create unit tests for parser preprocessor.
- Create unit tests for node inequivalece operator.
...@@ -165,6 +165,12 @@ class ExpressionBase(object): ...@@ -165,6 +165,12 @@ class ExpressionBase(object):
return s_root < o_root or s_exp < o_exp or s_coeff < o_coeff return s_root < o_root or s_exp < o_exp or s_coeff < o_coeff
def __ne__(self, other):
"""
Check strict inequivalence, using the strict equivalence operator.
"""
return not (self == other)
def is_op(self, *ops): def is_op(self, *ops):
return not self.is_leaf and self.op in ops return not self.is_leaf and self.op in ops
......
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