__contains__ - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


__contains__

test for membership in the Indexable

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

x.__contains__(y)

y in x

Parameters

x

-

Indexable object

y

-

any object

Description

• 

__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.

Examples

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

False

>>> 3 in S

True

>>> 2*maple.namespace.Pi in S

True

See Also

OpenMaple

OpenMaple/Python/API

OpenMaple/Python/Expression

OpenMaple/Python/Indexable

OpenMaple/Python/Indexable/__iter__

OpenMaple/Python/Indexable/__len__