From 60abcbc8e3a18d1dbba92aaa4689d9a50f08c17d Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 3 May 2021 18:31:58 -0700 Subject: [PATCH] Move assignment of backoff.x to the base class. --- voussoirkit/backoff.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/voussoirkit/backoff.py b/voussoirkit/backoff.py index 461710f..56c2188 100644 --- a/voussoirkit/backoff.py +++ b/voussoirkit/backoff.py @@ -18,6 +18,7 @@ calling end. For example, `bo.next() + (random.random() - 0.5)`. ''' class Backoff: def __init__(self, max): + self.x = 0 if max is None: pass elif max <= 0: @@ -49,7 +50,6 @@ class Exponential(Backoff): ''' def __init__(self, a, b, *, max): super().__init__(max) - self.x = 0 self.a = a self.b = b self.max = max @@ -63,7 +63,6 @@ class Linear(Backoff): ''' def __init__(self, m, b, *, max): super().__init__(max) - self.x = 0 self.m = m self.b = b self.max = max @@ -77,7 +76,6 @@ class Quadratic(Backoff): ''' def __init__(self, a, b, c, *, max): super().__init__(max) - self.x = 0 self.a = a self.b = b self.c = c