MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / Bucket

Class Bucket

example_code/item_059.py:53–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51from datetime import datetime, timedelta
52
53class Bucket:
54 def __init__(self, period):
55 self.period_delta = timedelta(seconds=period)
56 self.reset_time = datetime.now()
57 self.quota = 0
58
59 def __repr__(self):
60 return f"Bucket(quota={self.quota})"
61
62
63bucket = Bucket(60)

Callers 1

item_059.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected