Skip to content

Commit 49ee2dc

Browse files
authored
Merge pull request #543 from gaborbernat/simplepath-positional-only
Make SimplePath path parameters positional-only
2 parents 9757b40 + c0f3789 commit 49ee2dc

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

importlib_metadata/_meta.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ class SimplePath(Protocol):
5454
"""
5555

5656
def joinpath(
57-
self, other: str | os.PathLike[str]
57+
self, other: str | os.PathLike[str], /
5858
) -> SimplePath: ... # pragma: no cover
5959

6060
def __truediv__(
61-
self, other: str | os.PathLike[str]
61+
self, other: str | os.PathLike[str], /
6262
) -> SimplePath: ... # pragma: no cover
6363

6464
@property

newsfragments/542.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Marked the ``other`` parameter of ``SimplePath.joinpath`` and ``SimplePath.__truediv__`` positional-only, so ``pathlib.Path`` satisfies the protocol under type checkers that compare parameter names.

0 commit comments

Comments
 (0)