[issue21041] pathlib.PurePath.parents rejects negative indexes

akira report at bugs.python.org
Tue Apr 8 11:05:31 CEST 2014


akira added the comment:

>From https://docs.python.org/3/glossary.html#term-sequence

> An iterable which supports efficient element access using integer indices via the __getitem__() special method and defines a __len__() method that returns the length of the sequence.

.parents *is* a sequence. And it *is* confusing that it doesn't accept negative indexes -- that is how I've encountered the bug.

Antoine, could you elaborate on what are the negative consequences of negative indexes to justify breaking the expectations?

----------

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


More information about the Python-bugs-list mailing list