Skip to content

redis: fix more unconstrained TypeVars #8084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 87 additions & 11 deletions stubs/redis/redis/commands/core.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ class SortedSetCommands(Generic[_StrType]):
end: int,
desc: bool,
withscores: Literal[True],
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn] = ...,
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn],
byscore: bool = ...,
bylex: bool = ...,
offset: int | None = ...,
Expand All @@ -916,16 +916,43 @@ class SortedSetCommands(Generic[_StrType]):
name: _Key,
start: int,
end: int,
desc: bool = ...,
desc: bool,
withscores: Literal[True],
score_cast_func: Callable[[_StrType], float] = ...,
byscore: bool = ...,
bylex: bool = ...,
offset: int | None = ...,
num: int | None = ...,
) -> list[tuple[_StrType, float]]: ...
@overload
def zrange(
self,
name: _Key,
start: int,
end: int,
*,
withscores: Literal[True],
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn] = ...,
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn],
byscore: bool = ...,
bylex: bool = ...,
offset: int | None = ...,
num: int | None = ...,
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
@overload
def zrange(
self,
name: _Key,
start: int,
end: int,
*,
withscores: Literal[True],
score_cast_func: Callable[[_StrType], float] = ...,
byscore: bool = ...,
bylex: bool = ...,
offset: int | None = ...,
num: int | None = ...,
) -> list[tuple[_StrType, float]]: ...
@overload
def zrange(
self,
name: _Key,
Expand All @@ -946,9 +973,11 @@ class SortedSetCommands(Generic[_StrType]):
start: int,
end: int,
withscores: Literal[True],
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn] = ...,
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn],
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
@overload
def zrevrange(self, name: _Key, start: int, end: int, withscores: Literal[True]) -> list[tuple[_StrType, float]]: ...
@overload
def zrevrange(
self, name: _Key, start: int, end: int, withscores: bool = ..., score_cast_func: Callable[[Any], Any] = ...
) -> list[_StrType]: ...
Expand Down Expand Up @@ -980,9 +1009,13 @@ class SortedSetCommands(Generic[_StrType]):
num: int | None = ...,
*,
withscores: Literal[True],
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn] = ...,
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn],
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
@overload
def zrangebyscore(
self, name: _Key, min: _Value, max: _Value, start: int | None = ..., num: int | None = ..., *, withscores: Literal[True]
) -> list[tuple[_StrType, float]]: ...
@overload
def zrangebyscore(
self,
name: _Key,
Expand All @@ -1003,9 +1036,13 @@ class SortedSetCommands(Generic[_StrType]):
num: int | None = ...,
*,
withscores: Literal[True],
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn] = ...,
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn],
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
@overload
def zrevrangebyscore(
self, name: _Key, max: _Value, min: _Value, start: int | None = ..., num: int | None = ..., *, withscores: Literal[True]
) -> list[tuple[_StrType, float]]: ...
@overload
def zrevrangebyscore(
self,
name: _Key,
Expand Down Expand Up @@ -1068,13 +1105,27 @@ class AsyncSortedSetCommands(Generic[_StrType]):
end: int,
desc: bool,
withscores: Literal[True],
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn] = ...,
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn],
byscore: bool = ...,
bylex: bool = ...,
offset: int | None = ...,
num: int | None = ...,
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
@overload
async def zrange(
self,
name: _Key,
start: int,
end: int,
desc: bool,
withscores: Literal[True],
score_cast_func: Callable[[_StrType], float] = ...,
byscore: bool = ...,
bylex: bool = ...,
offset: int | None = ...,
num: int | None = ...,
) -> list[tuple[_StrType, float]]: ...
@overload
async def zrange(
self,
name: _Key,
Expand All @@ -1083,13 +1134,28 @@ class AsyncSortedSetCommands(Generic[_StrType]):
desc: bool = ...,
*,
withscores: Literal[True],
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn] = ...,
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn],
byscore: bool = ...,
bylex: bool = ...,
offset: int | None = ...,
num: int | None = ...,
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
@overload
async def zrange(
self,
name: _Key,
start: int,
end: int,
desc: bool = ...,
*,
withscores: Literal[True],
score_cast_func: Callable[[_StrType], float] = ...,
byscore: bool = ...,
bylex: bool = ...,
offset: int | None = ...,
num: int | None = ...,
) -> list[tuple[_StrType, float]]: ...
@overload
async def zrange(
self,
name: _Key,
Expand All @@ -1110,9 +1176,11 @@ class AsyncSortedSetCommands(Generic[_StrType]):
start: int,
end: int,
withscores: Literal[True],
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn] = ...,
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn],
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
@overload
async def zrevrange(self, name: _Key, start: int, end: int, withscores: Literal[True]) -> list[tuple[_StrType, float]]: ...
@overload
async def zrevrange(
self, name: _Key, start: int, end: int, withscores: bool = ..., score_cast_func: Callable[[Any], Any] = ...
) -> list[_StrType]: ...
Expand Down Expand Up @@ -1144,9 +1212,13 @@ class AsyncSortedSetCommands(Generic[_StrType]):
num: int | None = ...,
*,
withscores: Literal[True],
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn] = ...,
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn],
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
@overload
async def zrangebyscore(
self, name: _Key, min: _Value, max: _Value, start: int | None = ..., num: int | None = ..., *, withscores: Literal[True]
) -> list[tuple[_StrType, float]]: ...
@overload
async def zrangebyscore(
self,
name: _Key,
Expand All @@ -1167,9 +1239,13 @@ class AsyncSortedSetCommands(Generic[_StrType]):
num: int | None = ...,
*,
withscores: Literal[True],
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn] = ...,
score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn],
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
@overload
async def zrevrangebyscore(
self, name: _Key, max: _Value, min: _Value, start: int | None = ..., num: int | None = ..., *, withscores: Literal[True]
) -> list[tuple[_StrType, float]]: ...
@overload
async def zrevrangebyscore(
self,
name: _Key,
Expand Down