-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Change 'zrange' args type hints - adding Optional type hint for args that can be None #3610
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
base: master
Are you sure you want to change the base?
Conversation
Replace all occurrences of Union[T, None] = None and bare T = None with Optional[T] = None in zrange, _zrange, arrtrim, and other methods so that type checkers no longer report errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have several places where Union[int, None] is replaced with Optional[None]. Please check them and change to Optional[int]
…ations and correct arrtrim return type body: replaced all Union[T, None] = None and bare T = None with Optional[T] = None; changed arrtrim return annotation to Optional[int]
fingers crossed this one gets merged after the latest update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one more changes and it is done :)
@@ -4811,7 +4811,7 @@ def zunionstore( | |||
self, | |||
dest: KeyT, | |||
keys: Union[Sequence[KeyT], Mapping[AnyKeyT, float]], | |||
aggregate: Union[str, None] = None, | |||
aggregate: Optional[atr] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
atr --> str
Title:
fix(redis-client): change
zrange
num parameter type toOptional[int]
Pull Request check‑list
Description of change
This PR adjusts the signature of the
zrange
method inredis/commands/core.py
, changing thenum
parameter from a plainint = None
toOptional[int] = None
.