3 ms·
Iterators in Python are slightly different from lazy lists in languages like Haskell and Clojure. In Python, iterators are stateful; calling next() moves the it
by weavejester 16y ago
Iterators in Python are slightly different from lazy lists in languages like Haskell and Clojure. In Python, iterators are stateful; calling next() moves the iterator on, discarding the previous head. In Clojure, a seq has no state, and the head is not automatically discarded when the next item is accessed.