Closed
Description
Feature or enhancement
For typing and documentation purposes, it would be useful to define three protocols in pathlib:
Parser
: likeos.path
, but including only pure functionality that's essential forPurePathBase
- This already exists, but it's defined and used in an odd way.
DirEntry
: likeos.DirEntry
, but without some non-portable methods (likeinode()
)StatResult
: likeos.stat_result
, but without the tuple-like interface, and dropping non-essential attributes
These could be defined in a private module like pathlib._types
. For performance reasons that module shouldn't be imported by any other pathlib module.
If/when we make PathBase
public, we'll also make these protocols public.
See also: https://discuss.python.org/t/make-pathlib-extensible/3428/196
Linked PRs
Metadata
Metadata
Assignees
Labels
Python modules in the Lib dirPython modules in the Lib dirA feature request or enhancementA feature request or enhancement