Skip to content

Commit 3d352e8

Browse files
authored
Use proper return types for __await__ methods in redis.asyncio.client (#10379)
1 parent 8162faa commit 3d352e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stubs/redis/redis/asyncio/client.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from _typeshed import Incomplete, Unused
2-
from collections.abc import AsyncIterator, Awaitable, Callable, Iterable, Mapping, MutableMapping, Sequence
2+
from collections.abc import AsyncIterator, Awaitable, Callable, Generator, Iterable, Mapping, MutableMapping, Sequence
33
from datetime import datetime, timedelta
44
from types import TracebackType
55
from typing import Any, ClassVar, Generic, NoReturn, Protocol, overload
@@ -67,7 +67,7 @@ class Redis(AbstractRedis, RedisModuleCommands, AsyncCoreCommands[_StrType], Asy
6767
redis_connect_func: ConnectCallbackT | None = None,
6868
credential_provider: CredentialProvider | None = None,
6969
) -> None: ...
70-
def __await__(self): ...
70+
def __await__(self) -> Generator[Any, None, Self]: ...
7171
async def initialize(self) -> Self: ...
7272
def set_response_callback(self, command: str, callback: ResponseCallbackT): ...
7373
def load_external_module(self, funcname, func) -> None: ...
@@ -200,7 +200,7 @@ class Pipeline(Redis[_StrType], Generic[_StrType]):
200200
async def __aexit__(
201201
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
202202
) -> None: ...
203-
def __await__(self): ...
203+
def __await__(self) -> Generator[Any, None, Self]: ...
204204
def __len__(self) -> int: ...
205205
def __bool__(self) -> bool: ...
206206
async def reset(self) -> None: ... # type: ignore[override]

0 commit comments

Comments
 (0)