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 jsbueno
Recipients daniel.urban, jsbueno, mark.dickinson
Date 2011-04-13.23:41:06
SpamBayes Score 8.709397e-06
Marked as misclassified No
Message-id <1302738067.23.0.62178921904.issue11842@psf.upfronthosting.co.za>
In-reply-to
Content
I don't see this as a bug. The indices returned in both cases are exactly what you need to feed to range, in order to get the correct indices for the provided slice parameters.

Perceive that if for 
s = slice(None, None, -2)

It would return anything different from
(9, -1, -2)
It would be impossible to properly generate the desired indices. (With a 0 instead of -1, we would be missing the last index).

When you pass these numbers with the "[" "]" notation for being used as indices, the negative index is interpreted as "len(sequence) - index". In the case of "-1" in your example it is the same as "9" not the same as "one before zero".

I recommend closing this as not a bug.
History
Date User Action Args
2011-04-13 23:41:07jsbuenosetrecipients: + jsbueno, mark.dickinson, daniel.urban
2011-04-13 23:41:07jsbuenosetmessageid: <1302738067.23.0.62178921904.issue11842@psf.upfronthosting.co.za>
2011-04-13 23:41:06jsbuenolinkissue11842 messages
2011-04-13 23:41:06jsbuenocreate