Title: Typo in doc for itertools recipe of consume
Type: Stage:
Components: Documentation Versions: Python 3.1, Python 3.2, Python 3.3, Python 2.7, Python 2.6, Python 2.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, georg.brandl, joncle
Priority: normal Keywords:

Created on 2010-09-24 22:15 by joncle, last changed 2010-09-25 13:30 by georg.brandl. This issue is now closed.

Messages (2)
msg117339 - (view) Author: Jon Clements (joncle) Date: 2010-09-24 22:15
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)
        # 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.
msg117365 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-09-25 13:30
Thanks, fixed in r85008.
Date User Action Args
2010-09-25 13:30:19georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg117365

resolution: fixed
2010-09-24 22:15:42jonclecreate