]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-128520: pathlib ABCs: add `JoinablePath.__vfspath__()` (#133437)
authorBarney Gale <barney.gale@gmail.com>
Mon, 12 May 2025 18:00:36 +0000 (19:00 +0100)
committerGitHub <noreply@github.com>
Mon, 12 May 2025 18:00:36 +0000 (19:00 +0100)
commit5dbd27db7d79af88fb3f9b47f8b80438a147d349
tree44422a75ca931f679296bf630cf28a1842fad7bd
parent9f69a58623bd01349a18ba0c7a9cb1dad6a51e8e
GH-128520: pathlib ABCs: add `JoinablePath.__vfspath__()` (#133437)

In the abstract interface of `JoinablePath`, replace `__str__()` with
`__vfspath__()`. This frees user implementations of `JoinablePath` to
implement `__str__()` however they like (or not at all.)

Also add `pathlib._os.vfspath()`, which calls `__fspath__()` or
`__vfspath__()`.
Lib/glob.py
Lib/pathlib/__init__.py
Lib/pathlib/_os.py
Lib/pathlib/types.py
Lib/test/test_pathlib/support/lexical_path.py
Lib/test/test_pathlib/support/local_path.py
Lib/test/test_pathlib/support/zip_path.py
Lib/test/test_pathlib/test_join_windows.py