Skip to content

Commit 3a61d24

Browse files
authored
GH-99334: Explain that PurePath.is_relative_to() is purely lexical. (#114031)
1 parent 9af9ac1 commit 3a61d24

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
@@ -515,6 +515,13 @@ Pure paths provide the following methods and properties:
515515
>>> p.is_relative_to('/usr')
516516
False
517517

518+
This method is string-based; it neither accesses the filesystem nor treats
519+
"``..``" segments specially. The following code is equivalent:
520+
521+
>>> u = PurePath('/usr')
522+
>>> u == p or u in p.parents
523+
False
524+
518525
.. versionadded:: 3.9
519526

520527
.. deprecated-removed:: 3.12 3.14

0 commit comments

Comments
 (0)