Message332008
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. |
|
Date |
User |
Action |
Args |
2018-12-17 15:06:05 | thejcannon | set | recipients:
+ thejcannon, barry, pitrou, r.david.murray, akira |
2018-12-17 15:06:05 | thejcannon | set | messageid: <1545059165.15.0.788709270274.issue21041@psf.upfronthosting.co.za> |
2018-12-17 15:06:05 | thejcannon | link | issue21041 messages |
2018-12-17 15:06:04 | thejcannon | create | |
|