Message117339
Very low priority.
def consume(iterator, n):
"Advance the iterator n-steps ahead. If n is none, consume entirely."
# Use functions that consume iterators at C speed.
if n is None:
# feed the entire iterator into a zero-length deque
collections.deque(iterator, maxlen=0)
else:
# advance to the emtpy slice starting at position n
next(islice(iterator, n, n), None)
Hardly a show stoppper, and not me worth submitting a patch, but "emtpy" should be "empty". Just thought I'd make note of it before I forgot. |
|
Date |
User |
Action |
Args |
2010-09-24 22:15:44 | joncle | set | recipients:
+ joncle, docs@python |
2010-09-24 22:15:44 | joncle | set | messageid: <1285366544.01.0.313980902629.issue9944@psf.upfronthosting.co.za> |
2010-09-24 22:15:42 | joncle | link | issue9944 messages |
2010-09-24 22:15:41 | joncle | create | |
|