summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorYaroslav Pankovych <31005942+ypankovych@users.noreply.github.com>2020-11-23 20:06:22 (GMT)
committerGitHub <noreply@github.com>2020-11-23 20:06:22 (GMT)
commit79d2e62c008446fbbc6f264bb8a30e2d38b6ff58 (patch)
tree19897f3bf2d3abafff8fbcda7c51bcbb446265b6 /Doc
parentffae93248a33cd6fe73d1ea85d6802765bbf56d2 (diff)
downloadcpython-79d2e62c008446fbbc6f264bb8a30e2d38b6ff58.zip
cpython-79d2e62c008446fbbc6f264bb8a30e2d38b6ff58.tar.gz
cpython-79d2e62c008446fbbc6f264bb8a30e2d38b6ff58.tar.bz2
Added support for negative indexes to PurePath.parents (GH-21799)
This commit also fixes up some of the overlapping documentation changed in bpo-35498, which added support for indexing with slices. Fixes bpo-21041. https://bugs.python.org/issue21041 Co-authored-by: Paul Ganssle <p.ganssle@gmail.com> Co-authored-by: RĂ©mi Lapeyre <remi.lapeyre@henki.fr>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/pathlib.rst2
-rw-r--r--Doc/whatsnew/3.10.rst6
2 files changed, 6 insertions, 2 deletions
diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst
index 2071e7e..2bbf3aa 100644
--- a/Doc/library/pathlib.rst
+++ b/Doc/library/pathlib.rst
@@ -337,7 +337,7 @@ Pure paths provide the following methods and properties:
PureWindowsPath('c:/')
.. versionchanged:: 3.10
- Slice support was added.
+ The parents sequence now supports :term:`slices <slice>` and negative index values.
.. data:: PurePath.parent
diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst
index ce66b1d..f3e433a 100644
--- a/Doc/whatsnew/3.10.rst
+++ b/Doc/whatsnew/3.10.rst
@@ -247,9 +247,13 @@ pipe. (Contributed by Pablo Galindo in :issue:`41625`.)
pathlib
-------
-Added slice support to :meth:`~pathlib.Path.parents`.
+Added slice support to :attr:`PurePath.parents <pathlib.PurePath.parents>`.
(Contributed by Joshua Cannon in :issue:`35498`)
+Added negative indexing support to :attr:`PurePath.parents
+<pathlib.PurePath.parents>`.
+(Contributed by Yaroslav Pankovych in :issue:`21041`)
+
py_compile
----------