-
Notifications
You must be signed in to change notification settings - Fork 44
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
Inherit from PathBase
instead of Path
#193
Comments
Hi @barneygale Thank you for your message! I hope that I can get to this soon, so that it's ready for the Python3.13 release. I just saw that the 3.13 alpha is scheduled to release by the end of the month already. Are there any subtle changes that I should be aware of from versions 3.12 to 3.13? I currently assume that at some point in time I will be able to do: if sys.version_info >= (3, XX):
from pathlib import PathBase # or maybe pathlib.abc or somewhere else in the stdlib
else:
from pathlib_abc import PathBase
Do you have an idea how I could raise a deprecation warning when user code calls:
Metaclasses with custom
Yeah, ideally I would like to avoid having PosixUPath and WindowsUPath. But a while ago a few custom attributes and methods were added to UPath and so I needed to subclass. For relative paths, these are the only option as of now, because in the filesystem_spec world all paths are absolute. At some point in time, I think it would be good to have a Cheers, |
I don't think so :(. I think the best you could do is to raise a warning from |
This will be the next big change in
UPath
.In the near future we will derive from
pathlib_abc.PathBase
:We will have to consider a few things before this is possible:
isinstance(p, Path)
WindowsUPath
andPosixUPath
change?The text was updated successfully, but these errors were encountered: