https://github.com/python/cpython/commit/f5009b69e0cd94b990270e04e65b9d4d2b365844
commit: f5009b69e0cd94b990270e04e65b9d4d2b365844
branch: 3.12
author: Miss Islington (bot) <[email protected]>
committer: barneygale <[email protected]>
date: 2024-08-10T22:31:59+01:00
summary:

[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 363374cf69a7e2292fe3f1c6bedd199088958cc2)

Co-authored-by: Barney Gale <[email protected]>
Co-authored-by: Adam Turner <[email protected]>

files:
M Doc/library/pathlib.rst

diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst
index c5be7dc25b3271..44f976350ad7ed 100644
--- a/Doc/library/pathlib.rst
+++ b/Doc/library/pathlib.rst
@@ -167,8 +167,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`.
 
@@ -177,8 +177,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', 'Ximénez')
+      PureWindowsPath('c:/Users/Ximénez')
       >>> PureWindowsPath('//server/share/file')
       PureWindowsPath('//server/share/file')
 
@@ -762,8 +762,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`.
 
@@ -772,8 +772,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', 'Ximénez')
+      WindowsPath('c:/Users/Ximénez')
 
    *pathsegments* is specified similarly to :class:`PurePath`.
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to