This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
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
process
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 2022-04-11 14:57 by admin. 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)
    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.
msg117365 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-09-25 13:30
Thanks, fixed in r85008.
History
Date User Action Args
2022-04-11 14:57:06adminsetgithub: 54153
2010-09-25 13:30:19georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg117365

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