Author mark.dickinson
Recipients anakha, mark.dickinson
Date 2008-06-20.10:49:13
SpamBayes Score 0.0287791
Marked as misclassified No
Message-id <1213958957.75.0.23696560019.issue3004@psf.upfronthosting.co.za>
In-reply-to
Content
Here's a new patch that incorporates Arnaud's fix and tests, together with 
a few extra tests.

While I expect that this change will affect very little code, I think it's 
the right thing to do, because:

 - start and stop are now processed identically, making the source code
   easier to understand, and the behaviour easier to explain.

 - expected invariants now hold even in corner cases;  for example, after:

start, stop, step = my_slice.indices(length)

it's guaranteed that

0 <= start <= stop <= length    if step is positive, and
length-1 >= start >= stop >= -1 if step is negative.

However, I'd like a second opinion from another core developer before 
checking this in.
History
Date User Action Args
2008-06-20 10:49:18mark.dickinsonsetspambayes_score: 0.0287791 -> 0.0287791
recipients: + mark.dickinson, anakha
2008-06-20 10:49:17mark.dickinsonsetspambayes_score: 0.0287791 -> 0.0287791
messageid: <1213958957.75.0.23696560019.issue3004@psf.upfronthosting.co.za>
2008-06-20 10:49:16mark.dickinsonlinkissue3004 messages
2008-06-20 10:49:15mark.dickinsoncreate