Message352281
I checked conversation in #7951, tells about an ambiguity because it could be an index from a sequence or a key for a dict, like {-1: "foo"}.
Here there is no such confusion.
Confusion *may* arrise from the fact that it's not composed of parts, but more like it's already sliced, I mean it does NOT look like:
['/', 'home', 'mdk', 'clones', 'python']
It's more like:
['/home/mdk/clones/python', '/home/mdk/clones', '/home/mdk', '/home', '/']
In fact I'd say it behave more like a function call than a sequence access, I read:
pathlib.Path.cwd().parents[1]
a bit like:
pathlib.Path.cwd().parents(go_down=1)
It may explain why negative indices or slices were initially not implemented: It already looks like the result of a slice. |
|
Date |
User |
Action |
Args |
2019-09-13 10:30:41 | mdk | set | recipients:
+ mdk, barry, pitrou, r.david.murray, akira, thejcannon |
2019-09-13 10:30:40 | mdk | set | messageid: <1568370640.98.0.798830331069.issue21041@roundup.psfhosted.org> |
2019-09-13 10:30:40 | mdk | link | issue21041 messages |
2019-09-13 10:30:40 | mdk | create | |
|