# Feature or enhancement For typing and documentation purposes, it would be useful to define three protocols in pathlib: - `Parser`: like `os.path`, but including only pure functionality that's essential for `PurePathBase` - This [already exists](https://github.com/python/cpython/blob/328187cc4fcdd578db42cf6a16c197c3382157a7/Lib/pathlib/_abc.py#L38-L87), but it's defined and used in an odd way. - `DirEntry`: like `os.DirEntry`, but without some non-portable methods (like `inode()`) - `StatResult`: like `os.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 <!-- gh-linked-prs --> ### Linked PRs * gh-127494 * gh-127725 <!-- /gh-linked-prs -->