Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.1k
bpo-43012: removepathlib._Accessor
#25701
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
bpo-43012: removepathlib._Accessor
#25701
Uh oh!
There was an error while loading.Please reload this page.
Conversation
3941ea1
to5136c12
CompareNote that alot of my previous pathlib bugfixes were partly in preparation for making this diff look OK! I was hoping to highlight that I'm pretty sure the |
kfollstad commentedApr 29, 2021 • 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.
Bravo! I didn't realize yesterday with#25699 that it was temp code. I had seen your commits and misunderstood. I thought somehow your intent was to add a class in between Path and PurePath which leveraged moving all cwd, resolve, open, touch, into the accessor. I had done some performance testing that move of cwd, resolve, open, touch into the accessor and noted that it resulted in a significant slow down doing so.
I have to imagine that moving everything out will do the exact opposite and make all of these slow down go away and speed up all of the other functions that had used the accessor. That said, I'm just a guy out there who happens to be using pathlib, but I think this is brilliant. Myself, I had been wondering about changing the name of accessor to common (or something similar) having also seen Pitrou's comment to you, since it seemed like a vestigial abstraction. But I like taking it out entirely even better. Remove the cruft and make it faster - this seems like a win! |
Yep! And you'll note that the |
I'm also planning to perform an optimization pass, as I think there's a few |
barneygale commentedMay 13, 2021 • edited by bedevere-bot
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by bedevere-bot
Uh oh!
There was an error while loading.Please reload this page.
@pitrou I think you wrote this code originally - do you have the time/inclination to review? Thanks so much! @serhiy-storchaka As you improved the performance of globbing inbpo-26032, do you have any feedback on the |
As for |
0124153
to599e253
Compare
Thanks very much. I've renamed it to |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
I'll wait for#26153 to land before rebasing. |
b0dcbd2
to7a0882b
CompareI've rebased this PR. I believe it's ready for core review! |
This PR is stale because it has been open for 30 days with no activity. |
7a0882b
tod07f465
CompareI'm still keen to land this if possible. Thanks! |
b55c5e7
to013ddc6
ComparePlease avoid force push for future PRs, they make reviewing less pleasant:https://devguide.python.org/pullrequest/ |
Can you add a news entry? Can be just one line or two about removing an obsolete layer and preparing the terrain for upcoming enhancements. |
I've added a news entry now. I used your wording as it seemed spot on to me! |
These aren't necessary, and may slow things down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
To me this looks ready to merge. Is anyone else reviewing it?
Thank you for the reviews, everyone. If you can spare the time to continue reviewing this PR series, the next one is at#31085. Thanks so much! |
Python 3.11 removed pathlib._Accessor inpython/cpython#25701. Thisbroke our patch when it replaced a call to `os.getcwd()` with`Path.cwd()` in `Path.absolute()`. As a classmethod `Path.cwd()`receives the class as its implicit first argument meaning we can have 0or 1 arguments.
Uh oh!
There was an error while loading.Please reload this page.
Per Pitrou:
https://discuss.python.org/t/make-pathlib-extensible/3428/2
Accessors are:
Path
objects themselves (inc. subclasses)Path
objects, but once oncebpo-24132 is addressed there will be a supported route for that.This patch preserves all existing behaviour.
https://bugs.python.org/issue43012
Automerge-Triggered-By: GH:encukou