Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions token_bucket/limiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Limiter(object):
'_storage',
)

def __init__(self, rate, capacity, storage):
def __init__(self, rate, capacity, storage, ignore_subclass: bool = False):
if not isinstance(rate, (float, int)):
raise TypeError('rate must be an int or float')

Expand All @@ -78,7 +78,7 @@ def __init__(self, rate, capacity, storage):
if capacity < 1:
raise ValueError('capacity must be >= 1')

if not isinstance(storage, StorageBase):
if not isinstance(storage, StorageBase) and not ignore_subclass:
raise TypeError('storage must be a subclass of StorageBase')

self._rate = rate
Expand Down