gh-98832: Change wording in docstring of `pathlib.Path.iterdir` (GH-98833)

Found while working on https://github.com/python/cpython/issues/98829

Automerge-Triggered-By: GH:AlexWaygood
This commit is contained in:
Nikita Sobolev 2022-11-10 01:05:07 +03:00 committed by GitHub
parent 283ab0e1c0
commit 87f5180cd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -867,8 +867,10 @@ class Path(PurePath):
return os.path.samestat(st, other_st)
def iterdir(self):
"""Iterate over the files in this directory. Does not yield any
result for the special paths '.' and '..'.
"""Yield path objects of the directory contents.
The children are yielded in arbitrary order, and the
special entries '.' and '..' are not included.
"""
for name in os.listdir(self):
yield self._make_child_relpath(name)

View File

@ -0,0 +1 @@
Changes wording of docstring for :func:`pathlib.Path.iterdir`.