Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 33.9k
GH-101362: Omit path anchor from pathlib.PurePath()._parts#102476
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-101362: Omit path anchor from pathlib.PurePath()._parts#102476
Uh oh!
There was an error while loading. Please reload this page.
Conversation
barneygale commented Mar 6, 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.
Improve performance of path construction by skipping the addition of the path anchor (`drive + root`) to the internal `_parts` list. This change allows us to simplify the implementations of `joinpath()`, `name`, `parent`, and `parents` a little. The public `parts` tuple is unaffected.
barneygale commented Mar 6, 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'm not sure about this change - I don't like how it makes edit: addressed by renaming |
barneygale commented Mar 12, 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.
barneygale commented Apr 3, 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.
Updated timings: Something like a 10% speedup. |
Uh oh!
There was an error while loading. Please reload this page.
…ythonGH-102476) Improve performance of path construction by skipping the addition of the path anchor (`drive + root`) to the internal `_parts` list. Rename this attribute to `_tail` for clarity.
…ythonGH-102476) Improve performance of path construction by skipping the addition of the path anchor (`drive + root`) to the internal `_parts` list. Rename this attribute to `_tail` for clarity.
`pathlib.Path._parts` has been removed in Python 3.12: python/cpython#102476 Switch to pathlib.Path.parts which is a tuple. Closes#1934
`pathlib.Path._parts` has been removed in Python 3.12: python/cpython#102476 Switch to pathlib.Path.parts which is a tuple. Closes#1934
`pathlib.Path._parts` has been removed in Python 3.12: python/cpython#102476 Switch to pathlib.Path.parts which is a tuple. Closes#1934
`pathlib.Path._parts` has been removed in Python 3.12: python/cpython#102476 Switch to pathlib.Path.parts which is a tuple. Closes#1934
`pathlib.Path._parts` has been removed in Python 3.12: python/cpython#102476 Switch to pathlib.Path.parts which is a tuple. Closes#1934
Improve performance of path construction by skipping the addition of the path anchor (
drive + root) to the internal_partslist. Rename this attribute to_tailfor clarity.Also:
name,parent, andparentsa little._make_child_relpath()by building the new string path with naive string concatination rather than_format_parsed_parts().__hash__()and__eq__()by referring to the unsplit case-normalized path.__lt__()etc by referring to the naively split case-normalized path (i.e. split onsepwithout consideration of anchor)The public
partstuple is unaffected.