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.

Author NeilGirdhar
Recipients NeilGirdhar, docs@python
Date 2015-07-13.01:37:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1436751446.36.0.0536875668561.issue24624@psf.upfronthosting.co.za>
In-reply-to
Content
In the description of the consume recipe:

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 empty slice starting at position n
        next(islice(iterator, n, n), None)

iterator should be replaced with iterable.  This function accepts strings for example, which are not iterators.
History
Date User Action Args
2015-07-13 01:37:26NeilGirdharsetrecipients: + NeilGirdhar, docs@python
2015-07-13 01:37:26NeilGirdharsetmessageid: <1436751446.36.0.0536875668561.issue24624@psf.upfronthosting.co.za>
2015-07-13 01:37:26NeilGirdharlinkissue24624 messages
2015-07-13 01:37:24NeilGirdharcreate