Phillip J. Eby wrote:

> >It's not at all clear to me that "sticky" behavior is the best
> >default behavior, even with implicit adoptation. Would anyone in
> >their right mind expect the following to return [0, 1, 2, 3, 4, 5]
> >instead of [0, 1, 2, 0, 1, 2]?
> >
> >   >>> from itertools import *
> >   >>> seq = range(10)
> >   >>> list(chain(islice(seq, 3), islice(seq, 3)))
> >   [0, 1, 2, 0, 1, 2]
> >   >>>
> 
> I don't understand why you think it would.  What does islice have to
> do with adaptation?

islice() takes an iterator, yet I give it a sequence. It calls
iter(seq), which I see as a form of adaptation (maybe you don't). Sticky
adaptation would not be appropriate here, even though the adaptation is
implicit.

Just
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to