I think you can use `islice` in itertools.