Skip to content

Commit 7ca389c

Browse files
miss-islingtonbarneygaleAA-Turner
authored
[3.13] GH-120794: Use example paths with multiple parts in pathlib docs (GH-122887) (#122895)
GH-120794: Use example paths with multiple parts in pathlib docs (GH-122887) In the documentation of `PosixPath` and `WindowsPath`, and their `Pure*` equivalents, use example paths with multiple non-anchor parts. (cherry picked from commit 363374c) Co-authored-by: Barney Gale <barney.gale@gmail.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
1 parent b62f8c9 commit 7ca389c

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

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

773-
>>> PosixPath('/etc')
774-
PosixPath('/etc')
773+
>>> PosixPath('/etc/hosts')
774+
PosixPath('/etc/hosts')
775775

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

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

788-
>>> WindowsPath('c:/Program Files/')
789-
WindowsPath('c:/Program Files')
788+
>>> WindowsPath('c:/', 'Users', 'Ximénez')
789+
WindowsPath('c:/Users/Ximénez')
790790

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

0 commit comments

Comments
 (0)