We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
PurePath.is_relative_to()
1 parent 536b66f commit a199ab3Copy full SHA for a199ab3
Doc/library/pathlib.rst
@@ -509,6 +509,13 @@ Pure paths provide the following methods and properties:
509
>>> p.is_relative_to('/usr')
510
False
511
512
+ This method is string-based; it neither accesses the filesystem nor treats
513
+ "``..``" segments specially. The following code is equivalent:
514
+
515
+ >>> u = PurePath('/usr')
516
+ >>> u == p or u in p.parents
517
+ False
518
519
.. versionadded:: 3.9
520
521
.. deprecated-removed:: 3.12 3.14
0 commit comments