Terry Reedy <tjreedy at ...> writes: > class lookahead(): > "Wrap iterator with lookahead to both peek and test exhausted" ... +1 That's a nice tool that I'd love to have in itertools. Cheers, Wolfgang