Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
GH-89812: Addpathlib._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 ourterms of service andprivacy 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
This internal class excludes the `__fspath__()`, `__bytes__()` and`as_uri()` methods, which must not be inherited by a future`tarfile.TarPath` class.
pathlib._LexicalPath
pathlib._BasePurePath
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 commitd1b23c8.
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.
Would anyone be willing to review#104829? It blocks this PR. (please and thank you!) |
#104829 has landed, so test naming should be much improved! Think this is ready for review again. |
pathlib._BasePurePath
pathlib._PurePathExt
barneygale commentedJun 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 theearlier proposed hierarchy where The methods are moved to a new This changewill not be visible to users who try to instantiate Itwill be visible to users who subclass |
barneygale commentedJun 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.
Just a note that I’m meditating onhttps://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 commentedJun 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 addonly And if I were to do pathlib over again, I'd scrap the |
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 |
Uh oh!
There was an error while loading.Please reload this page.
Move
__fspath__()
,__bytes__()
andas_uri()
methods fromPurePath
to a new_PurePathExt
subclass. This new subclass is inherited byPurePosixPath
,PureWindowsPath
andPath
.Because
PurePath
isn't directly instantiatable (you get aPurePosixPath
orPureWindowsPath
instance back), this shouldn't change user-facing behaviour.The methods must not be inherited future
tarfile.TarPath
andpathlib.AbstractPath
classes, which will subclassPurePath
.