Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v5.1.0
======

* #415: Instrument ``SimplePath`` with generic support.

v5.0.0
======

Expand Down
9 changes: 5 additions & 4 deletions importlib_metadata/_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,19 @@ def json(self) -> Dict[str, Union[str, List[str]]]:
"""


class SimplePath(Protocol):
class SimplePath(Protocol[_T]):
"""
A minimal subset of pathlib.Path required by PathDistribution.
"""

def joinpath(self) -> 'SimplePath':
def joinpath(self) -> _T:
... # pragma: no cover

def __truediv__(self) -> 'SimplePath':
def __truediv__(self, other: Union[str, _T]) -> _T:
... # pragma: no cover

def parent(self) -> 'SimplePath':
@property
def parent(self) -> _T:
... # pragma: no cover

def read_text(self) -> str:
Expand Down