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 peter.otten
Recipients Muhammad.Alkarouri, georg.brandl, peter.otten, rhettinger
Date 2010-01-23.17:29:10
SpamBayes Score 0.0030563842
Marked as misclassified No
Message-id <1264267752.32.0.458118310293.issue7764@psf.upfronthosting.co.za>
In-reply-to
Content
As noted on comp.lang.python the implementation can be simplified to

def consume(items, n):
    next(islice(items, n, n), None)

When I suggested the above I wasn't aware that 

consume(items, None)

should exhaust the entire iterator. Unfortunately I've not found an elegant way to add that functionality.
History
Date User Action Args
2010-01-23 17:29:12peter.ottensetrecipients: + peter.otten, georg.brandl, rhettinger, Muhammad.Alkarouri
2010-01-23 17:29:12peter.ottensetmessageid: <1264267752.32.0.458118310293.issue7764@psf.upfronthosting.co.za>
2010-01-23 17:29:10peter.ottenlinkissue7764 messages
2010-01-23 17:29:10peter.ottencreate