]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] GH-99334: Explain that `PurePath.is_relative_to()` is purely lexical. (GH...
authorBarney Gale <barney.gale@gmail.com>
Tue, 23 Jan 2024 01:16:21 +0000 (01:16 +0000)
committerGitHub <noreply@github.com>
Tue, 23 Jan 2024 01:16:21 +0000 (01:16 +0000)
(cherry picked from commit 3a61d24062aaa1e13ba794360b6c765d9a1f2b06)

Doc/library/pathlib.rst

index 2d35285c12bd310615579f8bd68ce9d545f131cf..283e324a7f1b05f9fcffa47be3e4f82c31487171 100644 (file)
@@ -510,6 +510,13 @@ Pure paths provide the following methods and properties:
 
    If multiple arguments are supplied, they are joined together.
 
+   This method is string-based; it neither accesses the filesystem nor treats
+   "``..``" segments specially. The following code is equivalent:
+
+      >>> u = PurePath('/usr')
+      >>> u == p or u in p.parents
+      False
+
    .. versionadded:: 3.9