Do we want to include yet another library to solve this (quite simple) problem? Though I agree that the code with ``more_itertools`` would be much cleaner! :)

CC'ing @peterbe for input.