Skip to content

Commit 75cac31

Browse files
authored
Type hint Lock.extend's additional_time as a Number (#3522)
It must be possible for the function to receive floats, as the docstring and the code suggest.
1 parent 8427c7b commit 75cac31

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

redis/lock.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def do_release(self, expected_token: str) -> None:
264264
lock_name=self.name,
265265
)
266266

267-
def extend(self, additional_time: int, replace_ttl: bool = False) -> bool:
267+
def extend(self, additional_time: Number, replace_ttl: bool = False) -> bool:
268268
"""
269269
Adds more time to an already acquired lock.
270270
@@ -281,7 +281,7 @@ def extend(self, additional_time: int, replace_ttl: bool = False) -> bool:
281281
raise LockError("Cannot extend a lock with no timeout", lock_name=self.name)
282282
return self.do_extend(additional_time, replace_ttl)
283283

284-
def do_extend(self, additional_time: int, replace_ttl: bool) -> bool:
284+
def do_extend(self, additional_time: Number, replace_ttl: bool) -> bool:
285285
additional_time = int(additional_time * 1000)
286286
if not bool(
287287
self.lua_extend(

0 commit comments

Comments
 (0)