From 6fa7846eddafc0efebf4576207f62f45caef0ce6 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Thu, 21 Jul 2022 17:52:15 +0300 Subject: [PATCH] Annotate some `redis.backoff` items (#8352) --- stubs/redis/redis/backoff.pyi | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/stubs/redis/redis/backoff.pyi b/stubs/redis/redis/backoff.pyi index d10aaabb3..42990c02c 100644 --- a/stubs/redis/redis/backoff.pyi +++ b/stubs/redis/redis/backoff.pyi @@ -1,30 +1,29 @@ from abc import ABC, abstractmethod class AbstractBackoff(ABC): - def reset(self): ... + def reset(self) -> None: ... @abstractmethod - def compute(self, failures): ... + def compute(self, failures: int) -> float: ... class ConstantBackoff(AbstractBackoff): - def __init__(self, backoff) -> None: ... - def compute(self, failures): ... + def __init__(self, backoff: int) -> None: ... + def compute(self, failures: int) -> float: ... class NoBackoff(ConstantBackoff): def __init__(self) -> None: ... class ExponentialBackoff(AbstractBackoff): - def __init__(self, cap, base) -> None: ... - def compute(self, failures): ... + def __init__(self, cap: int, base: int) -> None: ... + def compute(self, failures: int) -> float: ... class FullJitterBackoff(AbstractBackoff): - def __init__(self, cap, base) -> None: ... - def compute(self, failures): ... + def __init__(self, cap: int, base: int) -> None: ... + def compute(self, failures: int) -> float: ... class EqualJitterBackoff(AbstractBackoff): - def __init__(self, cap, base) -> None: ... - def compute(self, failures): ... + def __init__(self, cap: int, base: int) -> None: ... + def compute(self, failures: int) -> float: ... class DecorrelatedJitterBackoff(AbstractBackoff): - def __init__(self, cap, base) -> None: ... - def reset(self) -> None: ... - def compute(self, failures): ... + def __init__(self, cap: int, base: int) -> None: ... + def compute(self, failures: int) -> float: ...