Macaulay2 » Documentation
Packages » Python » PythonObject » iterator(PythonObject)
next | previous | forward | backward | up | index | toc

iterator(PythonObject) -- get iterator of iterable python object

Description

This function works just like its Python counterpart. In particular, i is an iterator for the iterable object x.

i1 : builtins = import "builtins"

o1 = <module 'builtins' (built-in)>

o1 : PythonObject of class module
i2 : x = builtins@@range 3

o2 = range(0, 3)

o2 : PythonObject of class range
i3 : i = iterator x

o3 = <range_iterator object at 0x710294d5e970>

o3 : PythonObject of class range_iterator

See also

Ways to use this method:


The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Python/doc.m2:295:0.