Has Next in Python Iterators

Paul Rudin paul.nospam at rudin.co.uk
Thu Oct 21 09:35:06 EDT 2010


Kelson Zawack <zawackkfb at gis.a-star.edu.sg> writes:

> Since an iterator having an end is not actually an exceptional case...

There's no requirement on iterators to be finite, so in a sense it is.

In general it may be impractical to know whether an iterator has reached
the end without calling next().





More information about the Python-list mailing list