__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 SequenceParametersDescriptionExamples
<Text-field style="Heading 2" layout="Heading 2" bookmark="usage">Calling Sequence</Text-field>
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
<Text-field style="Heading 2" layout="Heading 2" bookmark="bkmrk0">Parameters</Text-field>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)
<Text-field style="Heading 2" layout="Heading 2" bookmark="info">Description</Text-field>
__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.
<Text-field style="Heading 2" layout="Heading 2" bookmark="examples">Examples</Text-field>
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 == yx=y>>> x != yx<>y>>> x <= yx<=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
See AlsoOpenMapleOpenMaple/Python/APIOpenMaple/Python/Expression