5.1.1.10.4. IteratorTools

This modules provides iterator tools.

CodeReview.Tools.IteratorTools.iter_with_last_flag(iterable)[source]

Iterate over an iterable and yield a 2-tuple containing the current item and a Boolean indicating if it is the last item.

CodeReview.Tools.IteratorTools.pairwise(iterable)[source]

Return a generator which generate a pair wise list from an iterable: s -> (s[0],s[1]), (s[1],s[2]), … (s[N-1], s[N]).