Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pathlib ABCs: prune PathBase interface #127381

Open
barneygale opened this issue Nov 29, 2024 · 0 comments
Open

pathlib ABCs: prune PathBase interface #127381

barneygale opened this issue Nov 29, 2024 · 0 comments
Labels
stdlib Python modules in the Lib dir topic-pathlib

Comments

@barneygale
Copy link
Contributor

barneygale commented Nov 29, 2024

It's time to make some difficult decisions about which methods deserve to stay in the pathlib._abc.PathBase interface, and which ought to be made pathlib.Path-only. Guidelines:

  • Compare to zipfile.Path and os.DirEntry; don't evict shared methods.
  • Include abstract methods only for the most basic functionality common to all virtual filesystems
  • Include concrete methods only when they combine abstract methods to produce widely useful functionality

Linked PRs

@barneygale barneygale added topic-pathlib type-feature A feature request or enhancement stdlib Python modules in the Lib dir and removed type-feature A feature request or enhancement labels Nov 29, 2024
barneygale added a commit to barneygale/cpython that referenced this issue Nov 29, 2024
Remove the `PathBase.lstat()` method, which is a trivial variation of
`stat()`.

No user-facing changes because the pathlib ABCs are still private.
barneygale added a commit to barneygale/cpython that referenced this issue Nov 29, 2024
barneygale added a commit that referenced this issue Nov 29, 2024
Remove the `PathBase.lstat()` method, which is a trivial variation of
`stat()`.

No user-facing changes because the pathlib ABCs are still private.
barneygale added a commit to barneygale/cpython that referenced this issue Nov 29, 2024
These classmethods presume that the user has retained the original
`__init__()` signature, which may not be the case. Also, many virtual
filesystems don't provide current or home directories.
barneygale added a commit that referenced this issue Nov 30, 2024
These classmethods presume that the user has retained the original
`__init__()` signature, which may not be the case. Also, many virtual
filesystems don't provide current or home directories.
picnixz pushed a commit to picnixz/cpython that referenced this issue Dec 2, 2024
Remove the `PathBase.lstat()` method, which is a trivial variation of
`stat()`.

No user-facing changes because the pathlib ABCs are still private.
picnixz pushed a commit to picnixz/cpython that referenced this issue Dec 2, 2024
…ython#127427)

These classmethods presume that the user has retained the original
`__init__()` signature, which may not be the case. Also, many virtual
filesystems don't provide current or home directories.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir topic-pathlib
Projects
None yet
Development

No branches or pull requests

1 participant