__iter__
return iterator to traverse the Indexable
Calling Sequence
Parameters
Description
Examples
x.__iter__()
iter(x)
x
-
Indexable object
__iter__ function returns a Python Iterator object for the Indexable x.
This allows Python-style iteration over the elements contained in the Indexable.
This function can also be called by simply entering iter(x) or used implicitly, such as in a for-in loop.
The following interactive session illustrates the use of an iterator used implicitly in a for-in loop over the container structure.
>>> import maple
>>> import maple.namespace
>>> S = maple.execute('{3,4,2*Pi,sqrt(2)};')
>>> for x in S: print(x)
3
4
2^(1/2)
2*Pi
See Also
OpenMaple
OpenMaple/Python/API
OpenMaple/Python/Expression
OpenMaple/Python/Indexable
OpenMaple/Python/Indexable/__contains__
OpenMaple/Python/Indexable/__len__
Download Help Document