Skip to content

GH-127456: pathlib ABCs: add protocol for path parser#127494

Merged
barneygale merged 12 commits intopython:mainfrom
barneygale:gh-127456
Dec 9, 2024
Merged

GH-127456: pathlib ABCs: add protocol for path parser#127494
barneygale merged 12 commits intopython:mainfrom
barneygale:gh-127456

Conversation

@barneygale
Copy link
Contributor

@barneygale barneygale commented Dec 1, 2024

Change the default value of PurePathBase.parser from ParserBase() to posixpath. As a result, user subclasses of PurePathBase and PathBase use POSIX path syntax by default, which is very often desirable.

Move pathlib._abc.ParserBase to pathlib._types.Parser, and convert it to a runtime-checkable protocol.

No user-facing changes as the pathlib ABCs are still private.

Loading
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.

6 participants