Skip to content

Commit

Permalink
Add default for SFTPClient.listdir
Browse files Browse the repository at this point in the history
At runtime, it's possible to call `listdir()` (i.e. without arguments)
and get a `Sequence[str]` back, due to the default argument in the
implementation. However, there is no `@overload` that contains 0
arguments, so mypy doesn't think that it's possible.

This adds the presence of the default to the sequence-of-strings
returning overload, to match the implementation
  • Loading branch information
tjstum committed Jul 17, 2024
1 parent 0eac029 commit b07a48d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion asyncssh/sftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -5168,7 +5168,7 @@ async def listdir(self, path: bytes) -> \
Sequence[bytes]: ... # pragma: no cover

@overload
async def listdir(self, path: FilePath) -> \
async def listdir(self, path: FilePath = ...) -> \
Sequence[str]: ... # pragma: no cover

async def listdir(self, path: _SFTPPath = '.') -> Sequence[BytesOrStr]:
Expand Down

0 comments on commit b07a48d

Please sign in to comment.