@@ -118,16 +118,16 @@ we also call *flavours*:
118
118
>>> PurePath()
119
119
PurePosixPath('.')
120
120
121
- When several absolute paths are given, the last is taken as an anchor
122
- (mimicking :func: `os.path.join `'s behaviour )::
121
+ If a segment is an absolute path, all previous segments are ignored
122
+ (like :func: `os.path.join `)::
123
123
124
124
>>> PurePath('/etc', '/usr', 'lib64')
125
125
PurePosixPath('/usr/lib64')
126
126
>>> PureWindowsPath('c:/Windows', 'd:bar')
127
127
PureWindowsPath('d:bar')
128
128
129
- However, in a Windows path, changing the local root doesn't discard the
130
- previous drive setting ::
129
+ On Windows, the drive is not reset when a rooted relative path
130
+ segment (e.g., `` r'\foo' ``) is encountered ::
131
131
132
132
>>> PureWindowsPath('c:/Windows', '/Program Files')
133
133
PureWindowsPath('c:/Program Files')
@@ -212,10 +212,10 @@ Paths of a different flavour compare unequal and cannot be ordered::
212
212
Operators
213
213
^^^^^^^^^
214
214
215
- The slash operator helps create child paths, mimicking the behaviour of
216
- :func: ` os.path.join `. For instance, when several absolute paths are given , the
217
- last is taken as an anchor; for a Windows path, changing the local root doesn't
218
- discard the previous drive setting ::
215
+ The slash operator helps create child paths, like :func: ` os.path.join `.
216
+ If the argument is an absolute path , the previous path is ignored.
217
+ On Windows, the drive is not reset when the argument is a rooted
218
+ relative path (e.g., `` r'\foo' ``) ::
219
219
220
220
>>> p = PurePath('/etc')
221
221
>>> p
0 commit comments