Skip to content

Commit

Permalink
Merge pull request #415 from layday/fix-simplepath-proto
Browse files Browse the repository at this point in the history
Instrument `SimplePath` protocol with generic support
  • Loading branch information
jaraco authored Nov 24, 2022
2 parents dcaa2d9 + c7d639e commit 0c4d6c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
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

0 comments on commit 0c4d6c6

Please sign in to comment.