-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
GH-100502: Add pathlib.PurePath.pathmod
attribute
#106533
GH-100502: Add pathlib.PurePath.pathmod
attribute
#106533
Conversation
This instance attribute stores the implementation of `os.path` used for low-level path operations: either `posixpath` or `ntpath`. The `PurePath` and `Path` initialisers gain a *flavour* keyword-only argument. This argument is not available in the Posix- and Windows-specific subclasses, and as the `PurePath` and `Path` classes are not directly instantiable, it is available therefore only in user subclasses of `PurePath` and `Path`. Such subclasses may determine their flavour in `__init__()` and supply the flavour to `super()`.
pathlib.PurePath.flavour
attributepathlib.PurePath.pathmod
attribute
Thank you for the review, @merwok! |
…thonGH-106533)" This reverts commit c6c5665.
Pardon the bump, but I figured this PR might be a good place to ask. @barneygale is there a specific reason why e.g. |
Alternatively, if your subclass is not concerned with the local filesystem, you could subclass from |
Thanks for the explanation, that makes sense. Curiosity satisfied :) I must admit that our use-case and restrictions are quite unique, overriding the methods as we need is indeed what we do now. Thanks for linking |
This class attribute stores the implementation of
os.path
used for low-level path operations: eitherposixpath
orntpath
.📚 Documentation preview 📚: https://cpython-previews--106533.org.readthedocs.build/