[issue21041] pathlib.PurePath.parents rejects negative indexes

akira report at bugs.python.org
Mon Jul 14 22:16:46 CEST 2014


akira added the comment:

> Aren't negative indexes well defined in Python?  

yes. I've provided the link to Python docs [1] in msg214642 that 
explicitly defines the behavior:

> If i or j is negative, the index is relative to the end of the string: 
> len(s) + i or len(s) + j is substituted. But note that -0 is still 0.

[1]: https://docs.python.org/3/library/stdtypes.html#sequence-types-list-tuple-range

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21041>
_______________________________________


More information about the Python-bugs-list mailing list