Skip to content

Commit a199ab3

Browse files
[3.12] GH-99334: Explain that PurePath.is_relative_to() is purely lexical. (GH-114031) (#114460)
(cherry picked from commit 3a61d24)
1 parent 536b66f commit a199ab3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Doc/library/pathlib.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,13 @@ Pure paths provide the following methods and properties:
509509
>>> p.is_relative_to('/usr')
510510
False
511511

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+
512519
.. versionadded:: 3.9
513520

514521
.. deprecated-removed:: 3.12 3.14

0 commit comments

Comments
 (0)