On Fri, 25 Apr 2008 10:24:16 +0200, Robert Bossy wrote: > John Machin wrote: >> On Apr 25, 5:44 pm, Robert Bossy <[EMAIL PROTECTED]> wrote: >> >>> Peter Otten wrote: >>> If the OP insists in not examining a[0] and a[1], this will do exactly >>> the same as the while version: >>> >>> for p in a[2:]: >>> if p: >>> print p >>> >>> >> >> ... at the cost of almost doubling the amount of memory required. > Indeed. Would it be a sensible proposal that sequence slices should > return an iterator instead of a list?
I don't think so as that would break tons of code that relies on the current behavior. Take a look at `itertools.islice()` if you want/need an iterator. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list