]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-43012: remove `pathlib._Accessor` (GH-25701)
authorBarney Gale <barney.gale@gmail.com>
Wed, 2 Feb 2022 12:38:25 +0000 (12:38 +0000)
committerGitHub <noreply@github.com>
Wed, 2 Feb 2022 12:38:25 +0000 (04:38 -0800)
commit08f8301b21648d58d053e1a513db8ed32fbf37dd
tree5653595bd4eb375f7931e22a3cacd47bfdcf25dd
parent187930f74c44e460ba09c60ba5d9bb4fac543d8f
bpo-43012: remove `pathlib._Accessor` (GH-25701)

Per Pitrou:

> The original intent for the “accessor” thing was to have a variant that did all accesses under a filesystem tree in a race condition-free way using openat and friends. It turned out to be much too hairy to actually implement, so was entirely abandoned, but the accessor abstraction was left there.

https://discuss.python.org/t/make-pathlib-extensible/3428/2

Accessors are:

- Lacking any internal purpose - '_NormalAccessor' is the only implementation
- Lacking any firm conceptual difference to `Path` objects themselves (inc. subclasses)
- Non-public, i.e. underscore prefixed - '_Accessor' and '_NormalAccessor'
- Unofficially used to implement customized `Path` objects, but once once [bpo-24132]() is addressed there will be a supported route for that.

This patch preserves all existing behaviour.
Lib/pathlib.py
Lib/test/test_pathlib.py
Misc/NEWS.d/next/Library/2022-01-05-03-09-29.bpo-43012.RVhLIL.rst [new file with mode: 0644]