Joshua Cannon <joshdcan...@gmail.com> added the comment:
I created issue35498 about .parents rejecting slices as well. (It was pointed out this discussion would probably decide that issue's fate) I think that .parents looking like a duck, but not quacking like one isn't very pythonic. Besides, the fact that p.parents[len(p.parents)-2] is allowed but p.parents[-2] is not just seems like extra steps. There's also list(p.parents)[-2], which is still not ideal. In either case, I'd imagine authors to put a comment like "PathLib .parents doesn't support negative indexes", which goes to show clients are expecting negative indices to work. I see that this issue is several years old. I'm happy to shepherd it if it needs further contributions. ---------- nosy: +thejcannon _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue21041> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com