mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
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>
This commit is contained in:
parent
f4f530804b
commit
8b3cccf3f9
7 changed files with 22 additions and 85 deletions
|
@ -634,8 +634,8 @@ class Path(PathBase, PurePath):
|
|||
path_str = path_str[:-1]
|
||||
yield path_str
|
||||
|
||||
def scandir(self):
|
||||
"""Yield os.DirEntry objects of the directory contents.
|
||||
def _scandir(self):
|
||||
"""Yield os.DirEntry-like objects of the directory contents.
|
||||
|
||||
The children are yielded in arbitrary order, and the
|
||||
special entries '.' and '..' are not included.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue