Mark Dickinson <[EMAIL PROTECTED]> added the comment:

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.

Added file: http://bugs.python.org/file10670/issue3004.patch

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3004>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to