pytoolz/toolz — pull request #169 by eriknw (2014-05-06 02:01:55+00:00)
Title: Add `toolz.utils.consume` to efficiently consume an iterator

`consume` is a convenience function that efficiently consumes an iterator. I find it useful for benchmarking, but I don't know if it's generally useful enough to be part of the main `toolz` API, which is why I put it in `toolz.utils`. If other people think it is useful enough, we could move it to `toolz.itertoolz`.

The method used (`deque(seq, 0)`) is really fast. The Cython implementation in `cytoolz` is even faster (and is what I really want)!