Peter Otten <[email protected]> added the comment:
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.
----------
nosy: +potten
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue7764>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com