Re: Final state of underlying sequence in islice

2010-11-06 Thread Peter Otten
Raymond Hettinger wrote: > If the RightAnswer(tm) is obvious to you, I would > like to hear it. It isnt ;) > If I had to make a choice right > now, I would choose stopping at the earlier possible > point rather than scanning to the next natural > boundary. +1 Not because it leaves the underl

Re: Final state of underlying sequence in islice

2010-11-05 Thread Shashank Singh
I have created an issue in roundup at http://bugs.python.org/issue10323. I was expecting the discussion to move to that place but since it has not, for the sake of completion I am quoting my response to Raymond that I had posted on roundup. > @Raymond: I don't have a particular use case where I ha

Re: Final state of underlying sequence in islice

2010-11-05 Thread Terry Reedy
On 11/5/2010 4:51 PM, Raymond Hettinger wrote: On Nov 5, 1:05 pm, Terry Reedy wrote: Currently, there are no promises or guarantees about the final state of the iterator. I interpret the current doc statement as a promise that becomes ambiguous when step> 1. You may have missed my point.

Re: Final state of underlying sequence in islice

2010-11-05 Thread Raymond Hettinger
On Nov 5, 3:52 pm, Ian wrote: > On Nov 5, 2:51 pm, Raymond Hettinger wrote: > > > You may have missed my point.  I wrote the tools, the docs, and the > > tests. > > If you interpret a "promise" in text, I can assure you it was not > > intended.  The behavior *is* undefined because I never defined

Re: Final state of underlying sequence in islice

2010-11-05 Thread Ian
On Nov 5, 2:51 pm, Raymond Hettinger wrote: > You may have missed my point.  I wrote the tools, the docs, and the > tests. > If you interpret a "promise" in text, I can assure you it was not > intended.  The behavior *is* undefined because I never defined it. > I'm happy to clarify the docs to mak

Re: Final state of underlying sequence in islice

2010-11-05 Thread Raymond Hettinger
On Nov 5, 1:05 pm, Terry Reedy wrote: > > Currently, there are no promises or guarantees about the final state > > of the iterator. > > I interpret the current doc statement as a promise that becomes > ambiguous when step > 1. You may have missed my point. I wrote the tools, the docs, and the te

Re: Final state of underlying sequence in islice

2010-11-05 Thread Terry Reedy
On 11/5/2010 4:58 AM, Raymond Hettinger wrote: Shashank Singh wrote: Are there any promises made with regard to final state of the underlying sequence that islice slices? Currently, there are no promises or guarantees about the final state of the iterator. I interpret the current doc sta

Re: Final state of underlying sequence in islice

2010-11-05 Thread Raymond Hettinger
>  Shashank Singh wrote: > > > Are there any promises made with regard to final state of the underlying > > sequence that islice slices? Currently, there are no promises or guarantees about the final state of the iterator. To the extent the pure Python version in the docs differs from the CPytho

Re: Final state of underlying sequence in islice

2010-11-04 Thread Terry Reedy
On 11/4/2010 12:42 PM, Shashank Singh wrote: Are there any promises made with regard to final state of the underlying sequence that islice slices? The one you quote below. for example consider this >>> from itertools import * >>> c = count() >>> list(islice(c, 1, 3, 50)) [1] >>> c.next(

Re: Final state of underlying sequence in islice

2010-11-04 Thread Ned Deily
In article , Shashank Singh wrote: > Are there any promises made with regard to final state of the underlying > sequence that islice slices? [...] > While "fixing" this should be rather easy in terms of the change in code > required it might break any code depending > on this seemingly incorrec