__contains__
test for membership in the Indexable
Calling Sequence
Parameters
Description
Examples
x.__contains__(y)
y in x
x
-
Indexable object
y
any object
__contains__ function returns true if the expression y exists in the Indexable x.
This function can also be called by simply entering y in x.
The following interactive session illustrates the use of __contains__:
>>> import maple
>>> import maple.namespace
>>> S = maple.execute('{3,4,2*Pi,sqrt(2)};')
>>> S.__contains__(2)
False
>>> S.__contains__(3)
True
>>> 2 in S
>>> 3 in S
>>> 2*maple.namespace.Pi in S
See Also
OpenMaple
OpenMaple/Python/API
OpenMaple/Python/Expression
OpenMaple/Python/Indexable
OpenMaple/Python/Indexable/__iter__
OpenMaple/Python/Indexable/__len__
Download Help Document