Skip to content

Commit

Permalink
bpo-15221: Update os.path.is*() documentation (GH-5185) (GH-5186)
Browse files Browse the repository at this point in the history
`os.path.is*()` can return False if the file can't be accessed.
The behaviour is documented in details in `os.path.exists()`.
Link to `os.path.exists()` from `os.path.is*()`.
(cherry picked from commit b3dd18d)
  • Loading branch information
miss-islington authored and Mariatta committed Jan 15, 2018
1 parent cf4cd4b commit bb80645
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Doc/library/os.path.rst
Original file line number Diff line number Diff line change
Expand Up @@ -246,26 +246,29 @@ the :mod:`glob` module.)

.. function:: isfile(path)

Return ``True`` if *path* is an existing regular file. This follows symbolic
links, so both :func:`islink` and :func:`isfile` can be true for the same path.
Return ``True`` if *path* is an :func:`existing <exists>` regular file.
This follows symbolic links, so both :func:`islink` and :func:`isfile` can
be true for the same path.

.. versionchanged:: 3.6
Accepts a :term:`path-like object`.


.. function:: isdir(path)

Return ``True`` if *path* is an existing directory. This follows symbolic
links, so both :func:`islink` and :func:`isdir` can be true for the same path.
Return ``True`` if *path* is an :func:`existing <exists>` directory. This
follows symbolic links, so both :func:`islink` and :func:`isdir` can be true
for the same path.

.. versionchanged:: 3.6
Accepts a :term:`path-like object`.


.. function:: islink(path)

Return ``True`` if *path* refers to a directory entry that is a symbolic link.
Always ``False`` if symbolic links are not supported by the Python runtime.
Return ``True`` if *path* refers to an :func:`existing <exists>` directory
entry that is a symbolic link. Always ``False`` if symbolic links are not
supported by the Python runtime.

.. versionchanged:: 3.6
Accepts a :term:`path-like object`.
Expand Down

0 comments on commit bb80645

Please sign in to comment.