Another itertool function?

Alex Martelli aleax at
Tue Apr 29 14:14:26 CEST 2003

Raymond Hettinger wrote:
> Here's another idea that was submitted:
> def windowed(iterable, group=2):
>     "returns (i[0], i[1], ... i[group-1]), (i[1], i[2], ... i[group]),

I think this would be perfect if the overlap between successively
returned windows was also a parameter, rather than being fixed to 1.


More information about the Python-list mailing list