__eq__
form equation including Expression
__ne__
form inequation including Expression
__ge__
form non-strict inequality including Expression
__gt__
form strict inequality including Expression
__le__
__lt__
Calling Sequence
Parameters
Description
Examples
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
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)
__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.
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.__ne__(y)
x <> y
>>> x.__le__(y)
See Also
OpenMaple
OpenMaple/Python/API
OpenMaple/Python/Expression
Download Help Document