@@ -205,21 +205,6 @@ def __str__(self):
205
205
passing to system calls."""
206
206
raise NotImplementedError
207
207
208
- def as_posix (self ):
209
- """Return the string representation of the path with forward (/)
210
- slashes."""
211
- return str (self ).replace (self .parser .sep , '/' )
212
-
213
- @property
214
- def drive (self ):
215
- """The drive prefix (letter or UNC path), if any."""
216
- return self .parser .splitdrive (self .anchor )[0 ]
217
-
218
- @property
219
- def root (self ):
220
- """The root of the path, if any."""
221
- return self .parser .splitdrive (self .anchor )[1 ]
222
-
223
208
@property
224
209
def anchor (self ):
225
210
"""The concatenation of the drive and root, or ''."""
@@ -291,51 +276,6 @@ def with_suffix(self, suffix):
291
276
else :
292
277
return self .with_name (stem + suffix )
293
278
294
- def relative_to (self , other , * , walk_up = False ):
295
- """Return the relative path to another path identified by the passed
296
- arguments. If the operation is not possible (because this is not
297
- related to the other path), raise ValueError.
298
-
299
- The *walk_up* parameter controls whether `..` may be used to resolve
300
- the path.
301
- """
302
- if not isinstance (other , PurePathBase ):
303
- other = self .with_segments (other )
304
- anchor0 , parts0 = _explode_path (self )
305
- anchor1 , parts1 = _explode_path (other )
306
- if anchor0 != anchor1 :
307
- raise ValueError (f"{ str (self )!r} and { str (other )!r} have different anchors" )
308
- while parts0 and parts1 and parts0 [- 1 ] == parts1 [- 1 ]:
309
- parts0 .pop ()
310
- parts1 .pop ()
311
- for part in parts1 :
312
- if not part or part == '.' :
313
- pass
314
- elif not walk_up :
315
- raise ValueError (f"{ str (self )!r} is not in the subpath of { str (other )!r} " )
316
- elif part == '..' :
317
- raise ValueError (f"'..' segment in { str (other )!r} cannot be walked" )
318
- else :
319
- parts0 .append ('..' )
320
- return self .with_segments (* reversed (parts0 ))
321
-
322
- def is_relative_to (self , other ):
323
- """Return True if the path is relative to another path or False.
324
- """
325
- if not isinstance (other , PurePathBase ):
326
- other = self .with_segments (other )
327
- anchor0 , parts0 = _explode_path (self )
328
- anchor1 , parts1 = _explode_path (other )
329
- if anchor0 != anchor1 :
330
- return False
331
- while parts0 and parts1 and parts0 [- 1 ] == parts1 [- 1 ]:
332
- parts0 .pop ()
333
- parts1 .pop ()
334
- for part in parts1 :
335
- if part and part != '.' :
336
- return False
337
- return True
338
-
339
279
@property
340
280
def parts (self ):
341
281
"""An object providing sequence-like access to the
@@ -387,11 +327,6 @@ def parents(self):
387
327
parent = split (path )[0 ]
388
328
return tuple (parents )
389
329
390
- def is_absolute (self ):
391
- """True if the path is absolute (has both a root and, if applicable,
392
- a drive)."""
393
- return self .parser .isabs (str (self ))
394
-
395
330
def match (self , path_pattern , * , case_sensitive = None ):
396
331
"""
397
332
Return True if this path matches the given pattern. If the pattern is
0 commit comments