Idioms with Python itertools