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 r.david.murray
Recipients docs@python, kgashok, martin.panter, r.david.murray, rhettinger, serhiy.storchaka, veky
Date 2017-09-18.15:55:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
You have to remember that the most useful way to think about python slice indexes is that they point between characters. Consider, for example, that you have a starting index of something, and you are looking backward in the string for a trailing delimiter:

  >>> x = 'this is <weird example> of something'
  >>> x.rfind('>', 9)
  >>> x[9:22]
  'weird example'

So the above is why 5 is different from 7: 5 is the index that you would use in a slice if you wanted the string that ended before the match...and the match in the null string case is the end of the string.  That is, Python is being consistent in this degenerate case.
Date User Action Args
2017-09-18 15:55:59r.david.murraysetrecipients: + r.david.murray, rhettinger, docs@python, martin.panter, serhiy.storchaka, veky, kgashok
2017-09-18 15:55:59r.david.murraysetmessageid: <>
2017-09-18 15:55:59r.david.murraylinkissue31504 messages
2017-09-18 15:55:59r.david.murraycreate