Skip to content

Commit 5b0ada9

Browse files
barneygalepicnixz
andauthored
Apply suggestions from code review
Co-authored-by: Bénédikt Tran <[email protected]>
1 parent 06477e4 commit 5b0ada9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Doc/library/pathlib.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ Reading directories
12911291

12921292
.. attribute:: Path.dir_entry
12931293

1294-
In a path yielded from :meth:`Path.iterdir`, this attribute stores a
1294+
In a path yielded from :meth:`Path.iterdir`, this attribute stores an
12951295
:class:`os.DirEntry` object corresponding to the path; in other cases it is
12961296
``None``. This can be used to retrieve the file type and attributes of
12971297
directory children without necessarily incurring further system calls::
@@ -1300,7 +1300,7 @@ Reading directories
13001300
>>> for child in p.iterdir():
13011301
... entry = child.dir_entry
13021302
... if entry.is_dir():
1303-
... child
1303+
... print(child)
13041304
...
13051305
PosixPath('docs/_templates')
13061306
PosixPath('docs/_build')

Doc/whatsnew/3.14.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,9 @@ pathlib
343343

344344
(Contributed by Barney Gale in :gh:`73991`.)
345345

346-
* Add a :attr:`.Path.dir_entry` attribute. In a path object generated by
347-
:meth:`.Path.iterdir`, it stores a :class:`os.DirEntry` object corresponding
348-
to the path; in other cases it is ``None``.
346+
* Add the :attr:`.Path.dir_entry` attribute. In a path object generated by
347+
:meth:`Path.iterdir <pathlib.Path.iterdir>`, it stores an :class:`os.DirEntry`
348+
object corresponding to the path; in other cases it is ``None``.
349349

350350
(Contributed by Barney Gale in :gh:`125413`.)
351351

0 commit comments

Comments
 (0)