From 8f8a39eacacaab5aa1e6723cb66f11943271ab50 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 20 Nov 2021 18:52:00 -0800 Subject: [PATCH] Add Ratelimiter.__repr__. --- voussoirkit/ratelimiter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/voussoirkit/ratelimiter.py b/voussoirkit/ratelimiter.py index e00f39c..df552cb 100644 --- a/voussoirkit/ratelimiter.py +++ b/voussoirkit/ratelimiter.py @@ -53,6 +53,9 @@ class Ratelimiter: self.last_operation = time.monotonic() self.balance = 0 + def __repr__(self): + return f'{self.__class__.__name__}(allowance={self.allowance}, period={self.period})' + @property def gain_rate(self): return self.allowance / self.period