Uh oh!
There was an error while loading. Please reload this page.
GH-89812: Add pathlib._PurePathExt - #104810
Conversation
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._PurePathExtI'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 |
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 🙂 |
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.