Skip to content

Commit

Permalink
pythonGH-120794: Use example paths with multiple parts in pathlib docs
Browse files Browse the repository at this point in the history
In the documentation of `PosixPath` and `WindowsPath`, and their `Pure*`
equivalents, use example paths with multiple non-anchor parts.
  • Loading branch information
barneygale committed Aug 10, 2024
1 parent 0fd97e4 commit f499107
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ we also call *flavours*:
A subclass of :class:`PurePath`, this path flavour represents non-Windows
filesystem paths::

>>> PurePosixPath('/etc')
PurePosixPath('/etc')
>>> PurePosixPath('/etc/hosts')
PurePosixPath('/etc/hosts')

*pathsegments* is specified similarly to :class:`PurePath`.

Expand All @@ -188,8 +188,8 @@ we also call *flavours*:
A subclass of :class:`PurePath`, this path flavour represents Windows
filesystem paths, including `UNC paths`_::

>>> PureWindowsPath('c:/Program Files/')
PureWindowsPath('c:/Program Files')
>>> PureWindowsPath('c:/', 'Users', 'Me')
PureWindowsPath('c:/Users/Me')
>>> PureWindowsPath('//server/share/file')
PureWindowsPath('//server/share/file')

Expand Down Expand Up @@ -783,8 +783,8 @@ calls on path objects. There are three ways to instantiate concrete paths:
A subclass of :class:`Path` and :class:`PurePosixPath`, this class
represents concrete non-Windows filesystem paths::

>>> PosixPath('/etc')
PosixPath('/etc')
>>> PosixPath('/etc/hosts')
PosixPath('/etc/hosts')

*pathsegments* is specified similarly to :class:`PurePath`.

Expand All @@ -798,8 +798,8 @@ calls on path objects. There are three ways to instantiate concrete paths:
A subclass of :class:`Path` and :class:`PureWindowsPath`, this class
represents concrete Windows filesystem paths::

>>> WindowsPath('c:/Program Files/')
WindowsPath('c:/Program Files')
>>> WindowsPath('c:/', 'Users', 'Me')
WindowsPath('c:/Users/Me')

*pathsegments* is specified similarly to :class:`PurePath`.

Expand Down

0 comments on commit f499107

Please sign in to comment.