Top Description Fields Constructors Methods
org.python.core

public Class PyEnumerate

extends PyIterator
Class Inheritance
Known Direct Subclasses
org.python.core.PyEnumerateDerived
Annotations
@ExposedType
name:enumerate
base:PyObject
doc:enumerate(iterable[, start]) -> iterator for index, value of iterable Return an enumerate object. iterable must be another object that supports iteration. The enumerate object yields pairs containing a count (from start, which defaults to zero) and a value yielded by the iterable argument. enumerate is useful for obtaining an indexed list: (0, seq[0]), (1, seq[1]), (2, seq[2]), ...
Imports
org.python.expose.ExposedMethod, .ExposedNew, .ExposedType

The Python builtin enumerate type.

Field Summary

Modifier and TypeField and Description
private PyObject
index

Current index of enumeration.

private PyObject
sit

Secondary iterator of enumeration.

public static final PyType
Inherited from org.python.core.PyIterator:
__doc__nextstopException

Constructor Summary

AccessConstructor and Description
public
public
PyEnumerate(PyType subType, PyObject seq, PyObject start)

public

Method Summary

Modifier and TypeMethod and Description
public PyObject
__iternext__()

Implements abstract org.python.core.PyIterator.__iternext__.

Return the next element of the sequence that this is an iterator for.

pack-priv final PyObject
pack-priv final PyObject
public static final PyObject
enumerate_new(PyNewWrapper new_, boolean init, PyType subtype, PyObject[] args, String[] keywords)

pack-priv final PyObject
public PyObject
next()

Overrides org.python.core.PyIterator.next.

The exposed next method.

public boolean
public int
traverse(Visitproc visit, Object arg)

Overrides org.python.core.PyIterator.traverse.

Implements org.python.core.Traverseproc.traverse.

Traverses all directly contained PyObjects.

Inherited from org.python.core.PyIterator:
__iter____tojava__doNextiterator

Field Detail

indexback to summary
private PyObject index

Current index of enumeration.

sitback to summary
private PyObject sit

Secondary iterator of enumeration.

TYPEback to summary
public static final PyType TYPE

Hides org.python.core.PyObject.TYPE.

Constructor Detail

PyEnumerateback to summary
public PyEnumerate(PyType subType)
PyEnumerateback to summary
public PyEnumerate(PyType subType, PyObject seq, PyObject start)
PyEnumerateback to summary
public PyEnumerate(PyObject seq, PyObject start)

Method Detail

__iternext__back to summary
public PyObject __iternext__()

Implements abstract org.python.core.PyIterator.__iternext__.

Doc from org.python.core.PyObject.__iternext__.

Return the next element of the sequence that this is an iterator for. Returns null when the end of the sequence is reached.

enumerate___iter__back to summary
pack-priv final PyObject enumerate___iter__()
Annotations
@ExposedMethod
doc:x.__iter__() <==> iter(x)
enumerate___iternext__back to summary
pack-priv final PyObject enumerate___iternext__()
enumerate_newback to summary
public static final PyObject enumerate_new(PyNewWrapper new_, boolean init, PyType subtype, PyObject[] args, String[] keywords)
Annotations
@ExposedNew
enumerate_nextback to summary
pack-priv final PyObject enumerate_next()
Annotations
@ExposedMethod
doc:x.next() -> the next value, or raise StopIteration
nextback to summary
public PyObject next()

Overrides org.python.core.PyIterator.next.

Doc from org.python.core.PyIterator.next.

The exposed next method. Note that exposed derivable subclasses of PyIterator should override next to call doNext(custom___iternext__), as __iternext__ is overridden by the Derived classes.

Returns:PyObject

a PyObject result

refersDirectlyToback to summary
public boolean refersDirectlyTo(PyObject ob)

Overrides org.python.core.PyIterator.refersDirectlyTo.

Implements org.python.core.Traverseproc.refersDirectlyTo.

Doc from org.python.core.Traverseproc.refersDirectlyTo.

Optional operation. Should only be implemented if it is more efficient than calling traverse(Visitproc, Object) with a visitproc that just watches out for ob. Must return false if ob is null.

Annotations
@Override
traverseback to summary
public int traverse(Visitproc visit, Object arg)

Overrides org.python.core.PyIterator.traverse.

Implements org.python.core.Traverseproc.traverse.

Doc from org.python.core.Traverseproc.traverse.

Traverses all directly contained PyObjects. Like in CPython, arg must be passed unmodified to visit as its second parameter. If Visitproc#visit(PyObject, Object) returns nonzero, this return value must be returned immediately by traverse. Visitproc#visit(PyObject, Object) must not be called with a null PyObject-argument.

Annotations
@Override