mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
GH-99334: Explain that PurePath.is_relative_to()
is purely lexical. (#114031)
This commit is contained in:
parent
9af9ac153a
commit
3a61d24062
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue