Skip to content

Commit 68377c4

Browse files
committed
Docs editing
1 parent 923542b commit 68377c4

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

Doc/library/pathlib.rst

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,9 +1197,9 @@ Querying file type and status
11971197
directory
11981198

11991199
If the path was generated from :meth:`Path.iterdir` then this attribute is
1200-
initialized with information about the file type gleaned from scanning the
1201-
parent. Merely accessing :attr:`Path.status` does not perform any
1202-
filesystem queries.
1200+
initialized with some information about the file type gleaned from scanning
1201+
the parent directory. Merely accessing :attr:`Path.status` does not perform
1202+
any filesystem queries.
12031203

12041204
To fetch up-to-date information, it's best to call :meth:`Path.is_dir`,
12051205
:meth:`~Path.is_file` and :meth:`~Path.is_symlink` rather than methods of
@@ -1957,34 +1957,34 @@ The :mod:`pathlib.types` module provides types for static type checking.
19571957

19581958
.. method:: exists(*, follow_symlinks=True)
19591959

1960-
Return ``True`` if this path status is for an existing file or
1961-
directory, or any other kind of file.
1960+
Return ``True`` if the path is an existing file or directory, or any
1961+
other kind of file; return ``False`` if the path doesn't exist.
19621962

19631963
If *follow_symlinks* is ``False``, return ``True`` for symlinks without
19641964
checking if their targets exist.
19651965

19661966
.. method:: is_dir(*, follow_symlinks=True)
19671967

1968-
Return ``True`` if this status is a directory or a symbolic link
1969-
pointing to a directory; return ``False`` if the status is or points to
1970-
any other kind of file, or if it doesnt exist.
1968+
Return ``True`` if the path is a directory, or a symbolic link pointing
1969+
to a directory; return ``False`` if the path is (or points to) any other
1970+
kind of file, or if it doesn't exist.
19711971

1972-
If *follow_symlinks* is ``False``, return ``True`` only if this status
1972+
If *follow_symlinks* is ``False``, return ``True`` only if the path
19731973
is a directory (without following symlinks); return ``False`` if the
1974-
status is any other kind of file or if it doesnt exist.
1974+
path is any other kind of file, or if it doesn't exist.
19751975

19761976
.. method:: is_file(*, follow_symlinks=True)
19771977

1978-
Return ``True`` if this status is a file or a symbolic link pointing to
1979-
a file; return ``False`` if the status is or points to a directory or
1980-
other non-file, or if it doesnt exist.
1978+
Return ``True`` if the path is a file, or a symbolic link pointing to
1979+
a file; return ``False`` if the path is (or points to) a directory or
1980+
other non-file, or if it doesn't exist.
19811981

1982-
If *follow_symlinks* is ``False``, return ``True`` only if this status
1983-
is a file (without following symlinks); return ``False`` if the status
1984-
is a directory or other other non-file, or if it doesnt exist.
1982+
If *follow_symlinks* is ``False``, return ``True`` only if the path
1983+
is a file (without following symlinks); return ``False`` if the path
1984+
is a directory or other other non-file, or if it doesn't exist.
19851985

19861986
.. method:: is_symlink()
19871987

1988-
Return ``True`` if this status is a symbolic link (even if broken);
1989-
return ``False`` if the status points to a directory or any kind of
1990-
file, or if it doesnt exist.
1988+
Return ``True`` if the path is a symbolic link (even if broken); return
1989+
``False`` if the path is a directory or any kind of file, or if it
1990+
doesn't exist.

Lib/pathlib/_local.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ def __repr__(self):
6060

6161

6262
class _PathStatus:
63-
"""This object provides os.DirEntry-like access to the file type and file
64-
attributes. Don't try to construct it yourself."""
63+
"""Implementation of pathlib.types.Status that provides file status
64+
information. Don't try to construct it yourself."""
6565
__slots__ = ('_path', '_repr', '_mode')
6666

6767
def __init__(self, path):
@@ -115,6 +115,9 @@ def is_symlink(self):
115115

116116

117117
class _DirEntryStatus:
118+
"""Implementation of pathlib.types.Status that provides file status
119+
information by querying a wrapped os.DirEntry object. Don't try to
120+
construct it yourself."""
118121
__slots__ = ('_entry', '_repr')
119122

120123
def __init__(self, path, entry):

0 commit comments

Comments
 (0)