From: Barney Gale Date: Tue, 23 Jan 2024 01:16:21 +0000 (+0000) Subject: [3.11] GH-99334: Explain that `PurePath.is_relative_to()` is purely lexical. (GH... X-Git-Tag: v3.11.8~100 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=20f3669ac2f989646f0e9ba42b3f658febb334c7;p=thirdparty%2FPython%2Fcpython.git [3.11] GH-99334: Explain that `PurePath.is_relative_to()` is purely lexical. (GH-114031) (#114461) (cherry picked from commit 3a61d24062aaa1e13ba794360b6c765d9a1f2b06) --- diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 2d35285c12bd..283e324a7f1b 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