Skip to content

Commit f5009b6

Browse files
miss-islingtonbarneygaleAA-Turner
authored
[3.12] GH-120794: Use example paths with multiple parts in pathlib docs (GH-122887) (#122896)
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 <[email protected]> Co-authored-by: Adam Turner <[email protected]>
1 parent d70c399 commit f5009b6

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
@@ -167,8 +167,8 @@ we also call *flavours*:
167167
A subclass of :class:`PurePath`, this path flavour represents non-Windows
168168
filesystem paths::
169169

170-
>>> PurePosixPath('/etc')
171-
PurePosixPath('/etc')
170+
>>> PurePosixPath('/etc/hosts')
171+
PurePosixPath('/etc/hosts')
172172

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

@@ -177,8 +177,8 @@ we also call *flavours*:
177177
A subclass of :class:`PurePath`, this path flavour represents Windows
178178
filesystem paths, including `UNC paths`_::
179179

180-
>>> PureWindowsPath('c:/Program Files/')
181-
PureWindowsPath('c:/Program Files')
180+
>>> PureWindowsPath('c:/', 'Users', 'Ximénez')
181+
PureWindowsPath('c:/Users/Ximénez')
182182
>>> PureWindowsPath('//server/share/file')
183183
PureWindowsPath('//server/share/file')
184184

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

765-
>>> PosixPath('/etc')
766-
PosixPath('/etc')
765+
>>> PosixPath('/etc/hosts')
766+
PosixPath('/etc/hosts')
767767

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

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

775-
>>> WindowsPath('c:/Program Files/')
776-
WindowsPath('c:/Program Files')
775+
>>> WindowsPath('c:/', 'Users', 'Ximénez')
776+
WindowsPath('c:/Users/Ximénez')
777777

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

0 commit comments

Comments
 (0)