I can check for a next()
method, but is that enough? Is there an ideomatic way?
answer from python sourcecode doc comments:
{python install path}/Versions/3.5/lib/python3.5/types.py
# Iterators in Python aren't a matter of type but of protocol. A large
# and changing number of builtin types implement *some* flavor of
# iterator. Don't check the type! Use hasattr to check for both
# "__iter__" and "__next__" attributes instead.