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

Online Help

All Products    Maple    MapleSim


__len__

test for membership in the Expression

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

x.__len__()

len(x)

Parameters

x

-

Expression object

Description

• 

__len__(x) returns the length of the Expression x as returned by the length function.

• 

This function can also be called by simply entering len(x).

Examples

The following interactive session illustrates the use of __len__:

>>> import maple

>>> import maple.namespace

>>> S = maple.execute('{3, 4, 2*Pi, sqrt(2)};')

>>> # It is most natural to use len as a function in prefix form without underscores

>>> len(S)

4

>>> # It may however also be used with the expr.methodName syntax

>>> S.__len__()

4

See Also

OpenMaple

OpenMaple/Python/API

OpenMaple/Python/Expression

OpenMaple/Python/Indexable/__contains__

OpenMaple/Python/Indexable/__iter__