mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
Use lowercase tuple where possible (#6170)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Any, Callable, Generic, Iterable, Iterator, Mapping, Sequence, Set, Text, Tuple, Type, TypeVar, Union, overload
|
||||
from typing import Any, Callable, Generic, Iterable, Iterator, Mapping, Sequence, Set, Text, Type, TypeVar, Union, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .connection import ConnectionPool
|
||||
@@ -492,13 +492,13 @@ class Redis(Generic[_StrType]):
|
||||
def unlink(self, *names: _Key) -> int: ...
|
||||
def unwatch(self): ...
|
||||
@overload
|
||||
def blpop(self, keys: _Value | Iterable[_Value], timeout: Literal[0] = ...) -> Tuple[_StrType, _StrType]: ...
|
||||
def blpop(self, keys: _Value | Iterable[_Value], timeout: Literal[0] = ...) -> tuple[_StrType, _StrType]: ...
|
||||
@overload
|
||||
def blpop(self, keys: _Value | Iterable[_Value], timeout: float) -> Tuple[_StrType, _StrType] | None: ...
|
||||
def blpop(self, keys: _Value | Iterable[_Value], timeout: float) -> tuple[_StrType, _StrType] | None: ...
|
||||
@overload
|
||||
def brpop(self, keys: _Value | Iterable[_Value], timeout: Literal[0] = ...) -> Tuple[_StrType, _StrType]: ...
|
||||
def brpop(self, keys: _Value | Iterable[_Value], timeout: Literal[0] = ...) -> tuple[_StrType, _StrType]: ...
|
||||
@overload
|
||||
def brpop(self, keys: _Value | Iterable[_Value], timeout: float) -> Tuple[_StrType, _StrType] | None: ...
|
||||
def brpop(self, keys: _Value | Iterable[_Value], timeout: float) -> tuple[_StrType, _StrType] | None: ...
|
||||
def brpoplpush(self, src, dst, timeout=...): ...
|
||||
def lindex(self, name: _Key, index: int) -> _StrType | None: ...
|
||||
def linsert(
|
||||
@@ -556,13 +556,13 @@ class Redis(Generic[_StrType]):
|
||||
store: _Key,
|
||||
groups: bool = ...,
|
||||
) -> int: ...
|
||||
def scan(self, cursor: int = ..., match: _Key | None = ..., count: int | None = ...) -> Tuple[int, list[_StrType]]: ...
|
||||
def scan(self, cursor: int = ..., match: _Key | None = ..., count: int | None = ...) -> tuple[int, list[_StrType]]: ...
|
||||
def scan_iter(self, match: Text | None = ..., count: int | None = ...) -> Iterator[_StrType]: ...
|
||||
def sscan(self, name: _Key, cursor: int = ..., match: Text = ..., count: int = ...) -> Tuple[int, list[_StrType]]: ...
|
||||
def sscan(self, name: _Key, cursor: int = ..., match: Text = ..., count: int = ...) -> tuple[int, list[_StrType]]: ...
|
||||
def sscan_iter(self, name, match=..., count=...): ...
|
||||
def hscan(
|
||||
self, name: _Key, cursor: int = ..., match: Text = ..., count: int = ...
|
||||
) -> Tuple[int, dict[_StrType, _StrType]]: ...
|
||||
) -> tuple[int, dict[_StrType, _StrType]]: ...
|
||||
def hscan_iter(self, name, match=..., count=...): ...
|
||||
def zscan(self, name, cursor=..., match=..., count=..., score_cast_func=...): ...
|
||||
def zscan_iter(self, name, match=..., count=..., score_cast_func=...): ...
|
||||
@@ -618,13 +618,13 @@ class Redis(Generic[_StrType]):
|
||||
def zpopmax(self, name: _Key, count: int | None = ...) -> list[_StrType]: ...
|
||||
def zpopmin(self, name: _Key, count: int | None = ...) -> list[_StrType]: ...
|
||||
@overload
|
||||
def bzpopmax(self, keys: _Key | Iterable[_Key], timeout: Literal[0] = ...) -> Tuple[_StrType, _StrType, float]: ...
|
||||
def bzpopmax(self, keys: _Key | Iterable[_Key], timeout: Literal[0] = ...) -> tuple[_StrType, _StrType, float]: ...
|
||||
@overload
|
||||
def bzpopmax(self, keys: _Key | Iterable[_Key], timeout: float) -> Tuple[_StrType, _StrType, float] | None: ...
|
||||
def bzpopmax(self, keys: _Key | Iterable[_Key], timeout: float) -> tuple[_StrType, _StrType, float] | None: ...
|
||||
@overload
|
||||
def bzpopmin(self, keys: _Key | Iterable[_Key], timeout: Literal[0] = ...) -> Tuple[_StrType, _StrType, float]: ...
|
||||
def bzpopmin(self, keys: _Key | Iterable[_Key], timeout: Literal[0] = ...) -> tuple[_StrType, _StrType, float]: ...
|
||||
@overload
|
||||
def bzpopmin(self, keys: _Key | Iterable[_Key], timeout: float) -> Tuple[_StrType, _StrType, float] | None: ...
|
||||
def bzpopmin(self, keys: _Key | Iterable[_Key], timeout: float) -> tuple[_StrType, _StrType, float] | None: ...
|
||||
@overload
|
||||
def zrange(
|
||||
self,
|
||||
@@ -635,7 +635,7 @@ class Redis(Generic[_StrType]):
|
||||
*,
|
||||
withscores: Literal[True],
|
||||
score_cast_func: Callable[[float], _ScoreCastFuncReturn] = ...,
|
||||
) -> list[Tuple[_StrType, _ScoreCastFuncReturn]]: ...
|
||||
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
|
||||
@overload
|
||||
def zrange(
|
||||
self,
|
||||
@@ -660,7 +660,7 @@ class Redis(Generic[_StrType]):
|
||||
*,
|
||||
withscores: Literal[True],
|
||||
score_cast_func: Callable[[float], _ScoreCastFuncReturn] = ...,
|
||||
) -> list[Tuple[_StrType, _ScoreCastFuncReturn]]: ...
|
||||
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
|
||||
@overload
|
||||
def zrangebyscore(
|
||||
self,
|
||||
@@ -687,7 +687,7 @@ class Redis(Generic[_StrType]):
|
||||
*,
|
||||
withscores: Literal[True],
|
||||
score_cast_func: Callable[[float], _ScoreCastFuncReturn] = ...,
|
||||
) -> list[Tuple[_StrType, _ScoreCastFuncReturn]]: ...
|
||||
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
|
||||
@overload
|
||||
def zrevrange(
|
||||
self,
|
||||
@@ -709,7 +709,7 @@ class Redis(Generic[_StrType]):
|
||||
*,
|
||||
withscores: Literal[True],
|
||||
score_cast_func: Callable[[float], _ScoreCastFuncReturn] = ...,
|
||||
) -> list[Tuple[_StrType, _ScoreCastFuncReturn]]: ...
|
||||
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
|
||||
@overload
|
||||
def zrevrangebyscore(
|
||||
self,
|
||||
@@ -757,7 +757,7 @@ class Redis(Generic[_StrType]):
|
||||
def script_load(self, script): ...
|
||||
def register_script(self, script: Text | _StrType) -> Script: ...
|
||||
def pubsub_channels(self, pattern: _Key = ...) -> list[Text]: ...
|
||||
def pubsub_numsub(self, *args: _Key) -> list[Tuple[Text, int]]: ...
|
||||
def pubsub_numsub(self, *args: _Key) -> list[tuple[Text, int]]: ...
|
||||
def pubsub_numpat(self) -> int: ...
|
||||
def monitor(self) -> Monitor: ...
|
||||
def memory_stats(self) -> dict[str, Any]: ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Mapping, Text, Tuple, Type
|
||||
from typing import Any, Mapping, Text, Type
|
||||
|
||||
ssl_available: Any
|
||||
hiredis_version: Any
|
||||
@@ -105,7 +105,7 @@ class Connection:
|
||||
def read_response(self): ...
|
||||
def pack_command(self, *args): ...
|
||||
def pack_commands(self, commands): ...
|
||||
def repr_pieces(self) -> list[Tuple[Text, Text]]: ...
|
||||
def repr_pieces(self) -> list[tuple[Text, Text]]: ...
|
||||
|
||||
class SSLConnection(Connection):
|
||||
description_format: Any
|
||||
@@ -144,7 +144,7 @@ class UnixDomainSocketConnection(Connection):
|
||||
health_check_interval: int = ...,
|
||||
client_name=...,
|
||||
) -> None: ...
|
||||
def repr_pieces(self) -> list[Tuple[Text, Text]]: ...
|
||||
def repr_pieces(self) -> list[tuple[Text, Text]]: ...
|
||||
|
||||
def to_bool(value: object) -> bool: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user