X Tutup
The Wayback Machine - https://web.archive.org/web/20240112011534/https://github.com/python/cpython/pull/113529
Skip to content
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-113528: Deoptimise pathlib._abc.PurePathBase.relative_to() #113529

Merged
merged 5 commits into from Jan 6, 2024

Conversation

barneygale
Copy link
Contributor

@barneygale barneygale commented Dec 28, 2023

Replace use of _from_parsed_parts() with with_segments() in PurePathBase.relative_to(), and move the assignment of _drv, _root and _tail_cached slots into PurePath.relative_to().

Replace use of `_from_parsed_parts()` with `with_segments()` in
`PurePathBase.relative_to()`, and move the assignment of `_drv`, `_root`,
`_tail_cached` and `_str` slots into `PurePath.relative_to()`.

Also shuffle a deprecation warning into `PurePath.relative_to()` to
ensure it's raised at the right stack level, and do the same in
`is_relative_to()` for code consistency.
@barneygale barneygale marked this pull request as draft January 5, 2024 21:57
@barneygale barneygale marked this pull request as ready for review January 5, 2024 23:09
@barneygale barneygale enabled auto-merge (squash) January 6, 2024 21:21
@barneygale barneygale merged commit a15a773 into python:main Jan 6, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant
X Tutup