Use proper return types for __await__ methods in redis.asyncio.client (#10379)

This commit is contained in:
Nikita Sobolev
2023-07-01 20:40:40 +03:00
committed by GitHub
parent 8162faa934
commit 3d352e85e5

View File

@@ -1,5 +1,5 @@
from _typeshed import Incomplete, Unused
from collections.abc import AsyncIterator, Awaitable, Callable, Iterable, Mapping, MutableMapping, Sequence
from collections.abc import AsyncIterator, Awaitable, Callable, Generator, Iterable, Mapping, MutableMapping, Sequence
from datetime import datetime, timedelta
from types import TracebackType
from typing import Any, ClassVar, Generic, NoReturn, Protocol, overload
@@ -67,7 +67,7 @@ class Redis(AbstractRedis, RedisModuleCommands, AsyncCoreCommands[_StrType], Asy
redis_connect_func: ConnectCallbackT | None = None,
credential_provider: CredentialProvider | None = None,
) -> None: ...
def __await__(self): ...
def __await__(self) -> Generator[Any, None, Self]: ...
async def initialize(self) -> Self: ...
def set_response_callback(self, command: str, callback: ResponseCallbackT): ...
def load_external_module(self, funcname, func) -> None: ...
@@ -200,7 +200,7 @@ class Pipeline(Redis[_StrType], Generic[_StrType]):
async def __aexit__(
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
) -> None: ...
def __await__(self): ...
def __await__(self) -> Generator[Any, None, Self]: ...
def __len__(self) -> int: ...
def __bool__(self) -> bool: ...
async def reset(self) -> None: ... # type: ignore[override]