OpenMaple/Python/Expression/__eq__ - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Home : Support : Online Help : OpenMaple/Python/Expression/__eq__

__eq__

form equation including Expression

__ne__

form inequation including Expression

__ge__

form non-strict inequality including Expression

__gt__

form strict inequality including Expression

__le__

form non-strict inequality including Expression

__lt__

form strict inequality including Expression

 Calling Sequence x.__eq__(y) x == y x.__ne__(y) x != y x.__ge__(y) x >= y x.__gt__(y) x > y x.__le__(y) x <= y x.__lt__(y) x < y

Parameters

 x - numeric or Expression object (if numeric, then y must be an Expression) y - numeric or Expression object (if numeric, then x must be an Expression)

Description

 • __eq__ returns an Expression corresponding to an equation formed from x and y.
 • This function can also be called by simply entering x==y.
 • __ne__ returns an Expression corresponding to an inequation formed from x and y.
 • This function can also be called by simply entering x==y.
 • __ge__, __gt__, __le__, __lt__ return Expressions corresponding to the inequalities >=, >, <=, < respectively. They can also be called simply using the corresponding binary operators in Python (for example x >= y).
 • Note that an equation is written as == in Python but as = in Maple syntax, while an inequation is written != in Python but as <> in Maple syntax.

Examples

The following interactive session illustrates the use of these operators.

 >>> import maple >>> import maple.namespace >>> x = maple.namespace.x >>> y = maple.namespace.y >>> # It is most natural to use these as infix operators >>> x == y x=y >>> x != y x<>y >>> x <= y x<=y >>> # They may, however, also be used with the expr.methodName syntax >>> x.__eq__(y) x=y >>> x.__ne__(y) x <> y >>> x.__le__(y) x <> y