Collection Interface ABCs

collections.abc.Iterator

Iterable objects implementing __next__, whose __iter__ returns themselves. Consumption advances their state.

Formal Syntax & Structure

python syntaxpython
collections.abc.Iterator

Return Value

type

Abstract base class object representing the described interface; use it for recognition or inheritance.

Working Example

Example Snippetpython
import collections.abcprint(isinstance(iter([1,2]),collections.abc.Iterator))
Python Reference