From 87b8ccc6f08f25fdae1995bb046767b5bbeab06a Mon Sep 17 00:00:00 2001 From: Barney Gale Date: Tue, 23 Jan 2024 01:06:44 +0000 Subject: [PATCH 1/2] GH-99334: Explain that `PurePath.is_relative_to()` is purely lexical. (#114031) (cherry picked from commit 3a61d24062aaa1e13ba794360b6c765d9a1f2b06) --- Doc/library/pathlib.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 2d35285c12bd31..283e324a7f1b05 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -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 From f8e04acda083d20e2e71715a8dd69da1441eb04e Mon Sep 17 00:00:00 2001 From: barneygale Date: Tue, 23 Jan 2024 01:08:26 +0000 Subject: [PATCH 2/2] [3.11] GH-99334: Explain that `PurePath.is_relative_to()` is purely lexical. (GH-114031). (cherry picked from commit 3a61d24062aaa1e13ba794360b6c765d9a1f2b06) Co-authored-by: Barney Gale