Skip to content
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::

>>> PurePath('foo//bar')
PurePosixPath('foo/bar')
>>> PurePath('//foo/bar')
PurePosixPath('//foo/bar')
>>> PurePath('foo/./bar')
PurePosixPath('foo/bar')
>>> PurePath('foo/../bar')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Document that :class:`pathlib.PurePath` does not collapse
initial double slashes because they denote UNC paths. Patch by Oleg Iarygin.