Skip to content

Commit

Permalink
pythonGH-110109: Add pathlib._PurePathBase
Browse files Browse the repository at this point in the history
Add private `pathlib._PurePathBase` class: a private superclass of both
`PurePath` and `_PathBase`. Unlike `PurePath`, it does not define any of
these special methods: `__fspath__`, `__bytes__`, `__reduce__`, `__hash__`,
`__eq__`, `__lt__`, `__le__`, `__gt__`, `__ge__`.

This is important for supporting *virtual paths*: user subclasses of
`_PathBase` that provide access to archive files, FTP servers, etc. In
these classes, the above methods should be implemented by users only as
appropriate, with due consideration for the hash/equality of any backing
objects, such as file objects or sockets.
  • Loading branch information
barneygale committed Oct 11, 2023
1 parent da0a68a commit 41a8de4
Show file tree
Hide file tree
Showing 3 changed files with 326 additions and 272 deletions.
Loading

0 comments on commit 41a8de4

Please sign in to comment.