bpo-24132: Add `pathlib._AbstractPath` by barneygale · Pull Request #31085 · python/cpython · GitHub

github.com

Tin mới

barneygale:bpo-24132-add-pathlib-abstractpath

GitHub CopilotWrite better code with AI

GitHub Copilot appDirect agents from issue to merge

ActionsAutomate any workflow

CodespacesInstant dev environments

IssuesPlan and track work

Code ReviewManage code changes

Code QualityEnforce quality at merge

GitHub Advanced SecurityFind and fix vulnerabilities

Code securitySecure your code as you build

Secret protectionStop leaks before they start

View all use cases

Financial services

View all industries

Software Development

GitHub SponsorsFund open source developers

Copilot for BusinessEnterprise-grade AI features

Premium SupportEnterprise-grade 24/7 support

Pull requests 2.6k

Security and quality 0

Move Path._make_child_relpath() to PurePath

Add _AbstractPath class

Optimize Path methods that may raise NotImplementedError

bpo-43012: remove pathlib._Accessor #25701

View reviewed changes

Subclass abc.ABC and decorate core methods with @abc.abstractmethod.

View reviewed changes

Learn more about hiding disruptive comments

The reason will be displayed to describe this comment to others. Learn more.

is an ABC at runtime

I love the overall idea of this PR, but I'm afraid I think trying to cram everything into one ABC is the wrong approach -- the interface still feels a little confused to me.

considered a Protocol

I love the overall idea of this PR, but I'm afraid I think trying to cram everything into one ABC is the wrong approach -- the interface still feels a little confused to me.

Remove quasi-abstract methods from AbstractPath

Merge branch 'main' into bpo-24132-add-pathlib-abstractpath

View reviewed changes

Improve _scandir() comment.

bpo-44136: pathlib: merge _Flavour.make_uri() into PurePath.as_uri() #30320

bpo-44136: pathlib: merge _Flavour.is_reserved() into PurePath.is_reserved() #30321

Remove speculation/promises from _AbstractPath docstring.

gh-68320, gh-88302 - Allow for pathlib.Path subclassing #31691

Merge branch 'main' into bpo-24132-add-pathlib-abstractpath

Tests fail on Python 3.10 google/etils#143

Direct sub-classing of pathlib.Path #68320

Fix python311 compatibility fsspec/universal_pathlib#69

implement tarfile.TarPath

Contrary to my earlier comments, I'm going to abandon this PR and continue the work elsewhere. Specifically, I'm planning to add a pathlib._AbstractPath class in order to implement tarfile.TarPath.

GH-89812: Add pathlib._PathBase #106337