Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
GH-89812: Add pathlib._PurePathExt#104810
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
barneygale commented May 23, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
This internal class excludes the `__fspath__()`, `__bytes__()` and `as_uri()` methods, which must not be inherited by a future `tarfile.TarPath` class.
pathlib._LexicalPathpathlib._BasePurePathbarneygale commented May 24, 2023
The test naming is pretty janky. #104829 will help. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Éric <merwok@netwok.org>
This reverts commit d1b23c8.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
barneygale commented Jun 7, 2023
Would anyone be willing to review #104829? It blocks this PR. (please and thank you!) |
barneygale commented Jun 14, 2023
#104829 has landed, so test naming should be much improved! Think this is ready for review again. |
pathlib._BasePurePathpathlib._PurePathExtbarneygale commented Jun 22, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
I've revised the implementation such that the methods are actually removed from (Contrast this with the earlier proposed hierarchy where The methods are moved to a new This change will not be visible to users who try to instantiate It will be visible to users who subclass |
barneygale commented Jun 22, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
merwok commented Jun 23, 2023
Just a note that I’m meditating on https://hynek.me/articles/python-subclassing-redux/ and linked articles at the moment and wondering if controlling subclass explosion in pathlib should be a guideline 🙂 |
barneygale commented Jun 23, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Oh I totally agree. I'd prefer to add only And if I were to do pathlib over again, I'd scrap the |
barneygale commented Jun 23, 2023
I've converted this back to a draft as I'm still in two minds about how to implement this. It's possible I'll add |



Move
__fspath__(),__bytes__()andas_uri()methods fromPurePathto a new_PurePathExtsubclass. This new subclass is inherited byPurePosixPath,PureWindowsPathandPath.Because
PurePathisn't directly instantiatable (you get aPurePosixPathorPureWindowsPathinstance back), this shouldn't change user-facing behaviour.The methods must not be inherited future
tarfile.TarPathandpathlib.AbstractPathclasses, which will subclassPurePath.