This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients anakha, mark.dickinson
Date 2008-06-20.09:59:11
SpamBayes Score 0.2468505
Marked as misclassified No
Message-id <5c6f2a5d0806200259h2f1442fep9a7bd258b6e333a7@mail.gmail.com>
In-reply-to <1213804606.86.0.198962035271.issue3004@psf.upfronthosting.co.za>
Content
On Wed, Jun 18, 2008 at 4:56 PM, Arnaud Bergeron <report@bugs.python.org>
wrote:

>
> Arnaud Bergeron <abergeron@gmail.com> added the comment:
>
> Would these do?
>
> self.assertEqual(slice(None,   -10    ).indices(10), (0,  0,  1))
> self.assertEqual(slice(None,   -11,   ).indices(10), (0,  0,  1))
> self.assertEqual(slice(None,   -12, -1).indices(10), (9, -1, -1))
>

Perfect.  Thank you.

If this is changed, then I think the following should also be
changed:

(9, 10, -1)

I believe the second index here should be 9, not 10.
Do you agree?

With these two changes the code, while marginally
more complicated, is actually easier to understand than
before, since exactly the same processing is applied
to both the start and stop indices.  I think this is as
it should be.
Files
File name Uploaded
unnamed mark.dickinson, 2008-06-20.09:59:09
History
Date User Action Args
2008-06-20 09:59:13mark.dickinsonsetspambayes_score: 0.246851 -> 0.2468505
recipients: + mark.dickinson, anakha
2008-06-20 09:59:11mark.dickinsonlinkissue3004 messages
2008-06-20 09:59:11mark.dickinsoncreate