mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-35498: Added slice support to PathLib parents attribute. (GH-11165)
Added slice support to the `pathlib.Path.parents` sequence. For a `Path` `p`, slices of `p.parents` should return the same thing as slices of `tuple(p.parents)`.
This commit is contained in:
parent
d20b7ed9c1
commit
4520584483
6 changed files with 42 additions and 0 deletions
|
@ -336,6 +336,8 @@ Pure paths provide the following methods and properties:
|
|||
>>> p.parents[2]
|
||||
PureWindowsPath('c:/')
|
||||
|
||||
.. versionchanged:: 3.10
|
||||
Slice support was added.
|
||||
|
||||
.. data:: PurePath.parent
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue