Commit d958125
fix: use KeysT for blpop and brpop keys parameter type annotation (#3987)
Fixes #3986
`blpop` and `brpop` accept a single key (str/bytes) or an iterable of
keys, which is handled internally by `list_or_args`. However, both
methods were annotated with the bare `List` type which made static
type-checkers (e.g. Pylance, mypy) reject single-string arguments.
The `KeysT = Union[KeyT, Iterable[KeyT]]` alias already exists in
`redis.typing` and is imported in this module. Updating both method
signatures to use `KeysT` aligns the annotations with the actual
runtime behaviour and eliminates the false-positive type errors.
Made-with: Cursor
Co-authored-by: Turan Almammadov <16321061+turanalmammadov@users.noreply.github.com>
Co-authored-by: petyaslavova <petya.slavova@redis.com>1 parent 75bf91b commit d958125
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2900 | 2900 | | |
2901 | 2901 | | |
2902 | 2902 | | |
2903 | | - | |
| 2903 | + | |
2904 | 2904 | | |
2905 | 2905 | | |
2906 | 2906 | | |
| |||
2921 | 2921 | | |
2922 | 2922 | | |
2923 | 2923 | | |
2924 | | - | |
| 2924 | + | |
2925 | 2925 | | |
2926 | 2926 | | |
2927 | 2927 | | |
| |||
0 commit comments