Skip to content

Commit

Permalink
Fix type hint annotations of expire time (#2361)
Browse files Browse the repository at this point in the history
* fix typehint annotations of expire time.

`ExpiryT` includes `float` type, but params of expiry-time (`ex`, `px`) for methods such as `set`, `expire`, `setnx`, etc. , should be `int`, not `float`.

* add `IntExpiryT` annotation.

* minor fix.

* minor fix.
  • Loading branch information
lucas-six authored Aug 29, 2022
1 parent 2a0405d commit fb54bdd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion redis/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
DecodedT = Union[str, int, float]
EncodableT = Union[EncodedT, DecodedT]
AbsExpiryT = Union[int, datetime]
ExpiryT = Union[float, timedelta]
ExpiryT = Union[int, timedelta]
ZScoreBoundT = Union[float, str] # str allows for the [ or ( prefix
BitfieldOffsetT = Union[int, str] # str allows for #x syntax
_StringLikeT = Union[bytes, str, memoryview]
Expand Down

0 comments on commit fb54bdd

Please sign in to comment.