[issue21041] pathlib.PurePath.parents rejects negative indexes

Joshua Cannon report at bugs.python.org
Fri Sep 13 09:26:18 EDT 2019


Joshua Cannon <joshdcannon at gmail.com> added the comment:

> it may explain why negative indices or slices were initially not implemented: It already looks like the result of a slice.

Sure the values of the sequence could be thought of as being increasingly smaller slices of some other sequence, however I don't think it changes the fact that "parents" is a sequence, and sequences have well-defined semantics for negative indices and slices. Semantics which people expect, and have to find smelly workarounds for.

----------

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


More information about the Python-bugs-list mailing list