diff options
author | Barney Gale <barney.gale@gmail.com> | 2024-12-05 21:39:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-05 21:39:43 (GMT) |
commit | 8b3cccf3f9508572d85b0044519f2bd5715dacad (patch) | |
tree | 9c5e6a23fa26ef59fa0db986ccf9bf4a1bd3a9a2 /Misc | |
parent | f4f530804b9d8f089eba0f157ec2144c03b13651 (diff) | |
download | cpython-8b3cccf3f9508572d85b0044519f2bd5715dacad.zip cpython-8b3cccf3f9508572d85b0044519f2bd5715dacad.tar.gz cpython-8b3cccf3f9508572d85b0044519f2bd5715dacad.tar.bz2 |
GH-125413: Revert addition of `pathlib.Path.scandir()` method (#127377)
Remove documentation for `pathlib.Path.scandir()`, and rename the method to
`_scandir()`. In the private pathlib ABCs, make `iterdir()` abstract and
call it from `_scandir()`.
It's not worthwhile to add this method at the moment - see discussion:
https://discuss.python.org/t/ergonomics-of-new-pathlib-path-scandir/71721
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/3.14.0a2.rst | 2 | ||||
-rw-r--r-- | Misc/NEWS.d/next/Library/2024-11-29-00-15-59.gh-issue-125413.WCN0vv.rst | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/Misc/NEWS.d/3.14.0a2.rst b/Misc/NEWS.d/3.14.0a2.rst index 7384ce5..d82ec98 100644 --- a/Misc/NEWS.d/3.14.0a2.rst +++ b/Misc/NEWS.d/3.14.0a2.rst @@ -597,7 +597,7 @@ TypeError is now raised instead of ValueError for some logical errors. .. nonce: Jat5kq .. section: Library -Add :meth:`pathlib.Path.scandir` method to efficiently fetch directory +Add :meth:`!pathlib.Path.scandir` method to efficiently fetch directory children and their file attributes. This is a trivial wrapper of :func:`os.scandir`. diff --git a/Misc/NEWS.d/next/Library/2024-11-29-00-15-59.gh-issue-125413.WCN0vv.rst b/Misc/NEWS.d/next/Library/2024-11-29-00-15-59.gh-issue-125413.WCN0vv.rst new file mode 100644 index 0000000..b56a77b --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-11-29-00-15-59.gh-issue-125413.WCN0vv.rst @@ -0,0 +1,3 @@ +Revert addition of :meth:`!pathlib.Path.scandir`. This method was added in +3.14.0a2. The optimizations remain for file system paths, but other +subclasses should only have to implement :meth:`pathlib.Path.iterdir`. |