SequenceIter
- class SequenceIter(*args, **kwargs)
The SequenceIter
struct is an opaque data type representing an
iterator pointing into a Sequence
.
Methods
- class SequenceIter
- compare(b: SequenceIter) int
Returns a negative number if
a
comes beforeb
, 0 if they are equal, and a positive number ifa
comes afterb
.The
a
andb
iterators must point into the same sequence.Added in version 2.14.
- Parameters:
b – a
SequenceIter
- move(delta: int) SequenceIter
Returns the
SequenceIter
which isdelta
positions away fromiter
. Ifiter
is closer than -delta
positions to the beginning of the sequence, the begin iterator is returned. Ifiter
is closer thandelta
positions to the end of the sequence, the end iterator is returned.Added in version 2.14.
- Parameters:
delta – A positive or negative number indicating how many positions away from
iter
the returnedSequenceIter
will be
- next() SequenceIter
Returns an iterator pointing to the next position after
iter
. Ifiter
is the end iterator, the end iterator is returned.Added in version 2.14.
- prev() SequenceIter
Returns an iterator pointing to the previous position before
iter
. Ifiter
is the begin iterator, the begin iterator is returned.Added in version 2.14.