From b07a48dc4c466daf80ceca91f2f85e6ad5754f62 Mon Sep 17 00:00:00 2001 From: Tim Stumbaugh Date: Mon, 15 Jul 2024 10:45:43 -0600 Subject: [PATCH] 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 --- asyncssh/sftp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asyncssh/sftp.py b/asyncssh/sftp.py index 3157096..e82209c 100644 --- a/asyncssh/sftp.py +++ b/asyncssh/sftp.py @@ -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]: