diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index ab92c142c37a4f..56d771fd8f040e 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -131,10 +131,13 @@ we also call *flavours*: >>> PurePath(Path('foo'), Path('bar')) PurePosixPath('foo/bar') - When *pathsegments* is empty, the current directory is assumed:: + When *pathsegments* is empty or consists only of empty strings, + the current directory is assumed:: - >>> PurePath() - PurePosixPath('.') + >>> PurePath(), PurePath('') + (PurePosixPath('.'), PurePosixPath('.')) + + The boolean value of either expression is True. If a segment is an absolute path, all previous segments are ignored (like :func:`os.path.join`):: @@ -1041,6 +1044,7 @@ Querying file type and status .. method:: Path.exists(*, follow_symlinks=True) Return ``True`` if the path points to an existing file or directory. + This includes empty paths, which Path interprets as the current directory. ``False`` will be returned if the path is invalid, inaccessible or missing. Use :meth:`Path.stat` to distinguish between these cases.