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

miss-islington webhook-mailer at python.org
Wed Nov 9 17:05:13 EST 2022


https://github.com/python/cpython/commit/87f5180cd79617223ac513e9f45933f774134e32
commit: 87f5180cd79617223ac513e9f45933f774134e32
branch: main
author: Nikita Sobolev <mail at sobolevn.me>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-11-09T14:05:07-08:00
summary:

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

files:
A Misc/NEWS.d/next/Documentation/2022-10-29-02-33-46.gh-issue-98832.DudEIH.rst
M Lib/pathlib.py

diff --git a/Lib/pathlib.py b/Lib/pathlib.py
index db1c7c9618ef..068d1b02f484 100644
--- a/Lib/pathlib.py
+++ b/Lib/pathlib.py
@@ -867,8 +867,10 @@ def samefile(self, other_path):
         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)
diff --git a/Misc/NEWS.d/next/Documentation/2022-10-29-02-33-46.gh-issue-98832.DudEIH.rst b/Misc/NEWS.d/next/Documentation/2022-10-29-02-33-46.gh-issue-98832.DudEIH.rst
new file mode 100644
index 000000000000..c4a456650251
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2022-10-29-02-33-46.gh-issue-98832.DudEIH.rst
@@ -0,0 +1 @@
+Changes wording of docstring for :func:`pathlib.Path.iterdir`.



More information about the Python-checkins mailing list