-
Notifications
You must be signed in to change notification settings - Fork 42
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
Heads up: pathlib._PathBase may be coming soon #114
Comments
Hi @barneygale Thank you for the heads up ❤️ I'll provide more detailed comments in the next days. One immediate thought would be, that from pathlib import Path, _VirtualPath
class UPath(_VirtualPath):
...
assert isinstance(UPath, Path) # will be False which won't allow users to use
class PureFSSpecPath(PurePath): # handles fsspec URI style paths
_flavour = fsspecpath # flavour for fsspec
...
class UPath(Path):
__new__ = ... # dispatches to FSSpecUPath if virtual, else PosixUPath or WindowsUPath
class PosixUPath(UPath, PosixPath): # shim to have localpaths also be instances of UPath
__slots__ = ()
class WindowsUPath(UPath, WindowsPath): # shim ...
__slots__ = ()
class FSSpecUpath(UPath, PureFSSpecUPath): # base class for virtual (fsspec based) filesystems.
__new__ = ... # dispatches to the filesystem specific implementations But I don't pass all the tests for the implementations yet, which is why it's not ready yet. I've pushed it to https://github.com/ap--/universal_pathlib/tree/pathlib-update, see: upath.core and upath._flavour Cheers, |
|
Hey - I've published CPython's private If the PyPI package succeeds and matures, I'm hopeful we can make |
I've logged a CPython PR that adds a private
pathlib._VirtualPath
class:python/cpython#106337
If/when that lands, it's not much more work to drop the underscore and introduce
pathlib.VirtualPath
to the world. This would be Python 3.13 at the earliest.Would it be suitable for use in universal_pathlib? It would be great to hear your feedback, thank you.
The text was updated successfully, but these errors were encountered: