Skip to content

Commit 363374c

Browse files
GH-120794: Use example paths with multiple parts in pathlib docs (#122887)
In the documentation of `PosixPath` and `WindowsPath`, and their `Pure*` equivalents, use example paths with multiple non-anchor parts. Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
1 parent 0959142 commit 363374c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Doc/library/pathlib.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ we also call *flavours*:
178178
A subclass of :class:`PurePath`, this path flavour represents non-Windows
179179
filesystem paths::
180180

181-
>>> PurePosixPath('/etc')
182-
PurePosixPath('/etc')
181+
>>> PurePosixPath('/etc/hosts')
182+
PurePosixPath('/etc/hosts')
183183

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

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

191-
>>> PureWindowsPath('c:/Program Files/')
192-
PureWindowsPath('c:/Program Files')
191+
>>> PureWindowsPath('c:/', 'Users', 'Ximénez')
192+
PureWindowsPath('c:/Users/Ximénez')
193193
>>> PureWindowsPath('//server/share/file')
194194
PureWindowsPath('//server/share/file')
195195

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

786-
>>> PosixPath('/etc')
787-
PosixPath('/etc')
786+
>>> PosixPath('/etc/hosts')
787+
PosixPath('/etc/hosts')
788788

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

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

801-
>>> WindowsPath('c:/Program Files/')
802-
WindowsPath('c:/Program Files')
801+
>>> WindowsPath('c:/', 'Users', 'Ximénez')
802+
WindowsPath('c:/Users/Ximénez')
803803

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

0 commit comments

Comments
 (0)