-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-featureA feature request or enhancementA feature request or enhancement
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
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-featureA feature request or enhancementA feature request or enhancement