Add a proper repr() for oyoyo.TokenBucket (useful for debugging)
This commit is contained in:
parent
4810bb408f
commit
ae5f78decc
@ -57,7 +57,8 @@ class TokenBucket(object):
|
|||||||
self.timestamp = now
|
self.timestamp = now
|
||||||
return self._tokens
|
return self._tokens
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return "{self.__class__.__name__}(capacity={self.capacity}, fill rate={self.fill_rate}, tokens={self.tokens})".format(self=self)
|
||||||
|
|
||||||
def add_commands(d):
|
def add_commands(d):
|
||||||
def dec(cls):
|
def dec(cls):
|
||||||
|
Loading…
Reference in New Issue
Block a user