Skip to content

GH-128520: pathlib ABCs: add JoinablePath.__vfspath__() #133437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

barneygale
Copy link
Contributor

@barneygale barneygale commented May 5, 2025

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__(). This will be exported as a public function in the pathlib-abc PyPI package.

Some related discussion here: https://discuss.python.org/t/protocol-for-virtual-filesystem-paths/82753

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__()` and/or
`__vfspath__()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant