Skip to content

Commit 3953bb8

Browse files
committed
fix: reject invalid LRU cache limits
1 parent 5a81599 commit 3953bb8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎Sprint-2/implement_lru_cache/lru_cache.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ def __init__(self,value,key):
77
self.key = key
88

99
def __init__(self, limit):
10+
if limit <= 0:
11+
raise ValueError("limit must be greater than 0")
1012
self.head = None
1113
self.tail = None
1214
self.limit = limit

0 commit comments

Comments
 (0)