]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-127807: pathlib ABCs: move private copying methods to dedicated class (#127810)
authorBarney Gale <barney.gale@gmail.com>
Sun, 22 Dec 2024 02:22:08 +0000 (02:22 +0000)
committerGitHub <noreply@github.com>
Sun, 22 Dec 2024 02:22:08 +0000 (02:22 +0000)
commit8d9f52a7be5c09c0fd4423943edadaacf6d7f917
tree6027636f753421b139f0ce77dabea3eab1d82052
parentf5ba74b81979b621e38be70ec3ddad1e7f1365ce
GH-127807: pathlib ABCs: move private copying methods to dedicated class (#127810)

Move 9 private `PathBase` attributes and methods into a new `CopyWorker`
class. Change `PathBase.copy` from a method to a `CopyWorker` instance.

The methods remain private in the `CopyWorker` class. In future we might
make some/all of them public so that user subclasses of `PathBase` can
customize the copying process (in particular reading/writing of metadata,)
but we'd need to make `PathBase` public first.
Lib/pathlib/_abc.py
Lib/pathlib/_local.py
Lib/pathlib/_os.py