From 58028a95ebc0504e77bfea54111ab11d6e24b942 Mon Sep 17 00:00:00 2001 From: crusaderky Date: Wed, 14 Oct 2020 16:31:18 +0100 Subject: [PATCH] cachetools ttl should be float (#4668) --- third_party/2and3/cachetools/func.pyi | 2 +- third_party/2and3/cachetools/ttl.pyi | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/third_party/2and3/cachetools/func.pyi b/third_party/2and3/cachetools/func.pyi index e1e6ac160..f9ebc79e1 100644 --- a/third_party/2and3/cachetools/func.pyi +++ b/third_party/2and3/cachetools/func.pyi @@ -8,4 +8,4 @@ _RET = Callable[[_F], _F] def lfu_cache(maxsize: int = ..., typed: bool = ...) -> _RET: ... def lru_cache(maxsize: int = ..., typed: bool = ...) -> _RET: ... def rr_cache(maxsize: int = ..., choice: Optional[Callable[[Sequence[_T]], _T]] = ..., typed: bool = ...) -> _RET: ... -def ttl_cache(maxsize: int = ..., ttl: int = ..., timer: float = ..., typed: bool = ...) -> _RET: ... +def ttl_cache(maxsize: int = ..., ttl: float = ..., timer: float = ..., typed: bool = ...) -> _RET: ... diff --git a/third_party/2and3/cachetools/ttl.pyi b/third_party/2and3/cachetools/ttl.pyi index 753e4e99b..db7618453 100644 --- a/third_party/2and3/cachetools/ttl.pyi +++ b/third_party/2and3/cachetools/ttl.pyi @@ -7,7 +7,7 @@ _VT = TypeVar("_VT") class TTLCache(Cache[_KT, _VT]): def __init__( - self, maxsize: int, ttl: int, timer: Callable[[], float] = ..., getsizeof: Optional[Callable[[_VT], int]] = ... + self, maxsize: int, ttl: float, timer: Callable[[], float] = ..., getsizeof: Optional[Callable[[_VT], int]] = ... ) -> None: ... def __getitem__(self, key: _KT, cache_getitem: Callable[[_KT], _VT] = ...) -> _VT: ... def __setitem__(self, key: _KT, value: _VT, cache_setitem: Callable[[_KT, _VT], None] = ...) -> None: ... @@ -19,5 +19,5 @@ class TTLCache(Cache[_KT, _VT]): @property def timer(self) -> Callable[[], float]: ... @property - def ttl(self) -> int: ... + def ttl(self) -> float: ... def expire(self, time: Optional[Callable[[], float]] = ...) -> None: ...