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:
Joshua Cannon 2020-11-20 09:40:39 -06:00 committed by GitHub
parent d20b7ed9c1
commit 4520584483
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 42 additions and 0 deletions

View file

@ -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