GH-99334: Explain that PurePath.is_relative_to() is purely lexical. (#114031)

This commit is contained in:
Barney Gale 2024-01-23 01:06:44 +00:00 committed by GitHub
parent 9af9ac153a
commit 3a61d24062
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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