[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-11-23 Thread Yaroslav Pankovych
Yaroslav Pankovych added the comment: Agree with that, it currently supports this behavior. -- ___ Python tracker <https://bugs.python.org/issue21041> ___ ___

[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-11-23 Thread Yaroslav Pankovych
Yaroslav Pankovych added the comment: And it looks like a special case, so "Special cases aren't special enough to break the rules." -- ___ Python tracker <https://bugs.python.o

[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-11-21 Thread Yaroslav Pankovych
Yaroslav Pankovych added the comment: That makes sense, but should we have this behaviour only for negative indices? We'll end up with something lie: path.parents[len(path.parents) - 1] != path.parents[-1] I think that is should be consistent regardless of negative/positive indices

[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-08-22 Thread Yaroslav Pankovych
Yaroslav Pankovych added the comment: Any thoughts about that folks? It's a pretty old bug, let's decide smth for it. -- ___ Python tracker <https://bugs.python.org/issue21

[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-08-10 Thread Yaroslav Pankovych
Yaroslav Pankovych added the comment: Here's possible fix: https://github.com/python/cpython/pull/21799 -- ___ Python tracker <https://bugs.python.org/issue21

[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-08-10 Thread Yaroslav Pankovych
Yaroslav Pankovych added the comment: That's kinda weird for python. I mean, in regular list/etc if I need the last element, I'd normally do list[-1], but here to get the last parent, I need to actually know how many parents do I have. So now, I can do something like