Skip to content

Commit 4b4aa73

Browse files
tjstumronf
authored andcommitted
Add default for SFTPClient.listdir
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
1 parent 3f5717e commit 4b4aa73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

asyncssh/sftp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5166,7 +5166,7 @@ async def listdir(self, path: bytes) -> \
51665166
Sequence[bytes]: ... # pragma: no cover
51675167

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

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

0 commit comments

Comments
 (0)