Skip to content
Next Next commit
Document that Path does not collapse initial //
  • Loading branch information
arhadthedev committed Mar 30, 2022
commit fb499371afac8fccd4db1a17bc9b8fe6c47bc826
7 changes: 5 additions & 2 deletions Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,14 @@ we also call *flavours*:
PureWindowsPath('c:/Program Files')

Spurious slashes and single dots are collapsed, but double dots (``'..'``)
are not, since this would change the meaning of a path in the face of
symbolic links::
and initial double slashes (``'//'``) are not, since this would change the
meaning of a path in the face of symbolic links and UNC (network) paths
respectively::
Comment thread
arhadthedev marked this conversation as resolved.
Outdated

>>> PurePath('foo//bar')
PurePosixPath('foo/bar')
>>> PurePath('//foo/bar')
PurePosixPath('//foo/bar')
>>> PurePath('foo/./bar')
PurePosixPath('foo/bar')
>>> PurePath('foo/../bar')
Expand Down