Skip to content

Conversation

@barneygale
Copy link
Contributor

@barneygalebarneygale commented Nov 13, 2023

Re-arrange pathlib.PurePath methods in source code. Ditto for PurePathTest. No other changes.

The PurePath implementations of certain special methods, such as __eq__() and __hash__(), are not usually applicable to user subclasses of _PathBase. To facilitate their removal, another patch will split the PurePath class into _PurePathBase and PurePath, with the latter providing these special methods.

This patch prepares the ground for splitting PurePath. It's similar to e8d77b0, which preceded splitting Path. By churning the methods here, subsequent patches will be easier to review and less likely to break things.

Re-arrange `pathlib.PurePath` methods in source code. No other changes. The `PurePath` implementations of certain special methods, such as `__eq__()` and `__hash__()`, are not usually applicable to user subclasses of `_PathBase`. To facilitate their removal, another patch will split the `PurePath` class into `_PurePathBase` and `PurePath`, with the latter providing these special methods. This patch prepares the ground for splitting `PurePath`. It's similar to e8d77b0, which preceded splitting `Path`. By churning the methods here, subsequent patches will be easier to review and less likely to break things.
@barneygale
Copy link
ContributorAuthor

@JelleZijlstra I requested your review as you previously approved #104243, which did a similar thing to pathlib.Path. Thank you!

@JelleZijlstraJelleZijlstra merged commit 2dbb2e0 into python:mainNov 17, 2023
@barneygale
Copy link
ContributorAuthor

Thanks!

aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Re-arrange `pathlib.PurePath` methods in source code. No other changes. The `PurePath` implementations of certain special methods, such as `__eq__()` and `__hash__()`, are not usually applicable to user subclasses of `_PathBase`. To facilitate their removal, another patch will split the `PurePath` class into `_PurePathBase` and `PurePath`, with the latter providing these special methods. This patch prepares the ground for splitting `PurePath`. It's similar to e8d77b0, which preceded splitting `Path`. By churning the methods here, subsequent patches will be easier to review and less likely to break things.
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Re-arrange `pathlib.PurePath` methods in source code. No other changes. The `PurePath` implementations of certain special methods, such as `__eq__()` and `__hash__()`, are not usually applicable to user subclasses of `_PathBase`. To facilitate their removal, another patch will split the `PurePath` class into `_PurePathBase` and `PurePath`, with the latter providing these special methods. This patch prepares the ground for splitting `PurePath`. It's similar to e8d77b0, which preceded splitting `Path`. By churning the methods here, subsequent patches will be easier to review and less likely to break things.
Sign up for freeto 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.

2 participants

@barneygale@JelleZijlstra