Ian Kelly <ian.g.kelly <at> gmail.com> writes: > Depending on your Python version lst is either a range object or a > list, neither of which is an iterator. If you pass to consume an > iterable object that is not an iterator, it will implicitly obtain an > iterator for it, consume from the iterator, and then discard the > iterator, with no effect on the original object. > > In general the itertools functions will work equally well on iterators > and other iterables, but consume is special in that what it does is > only relevant to iterators.
Thanks for the explanation. I clearly still need to grapple with this stuff a bit... Skip -- http://mail.python.org/mailman/listinfo/python-list