Creates an empty store and map for the keys. The LRUCache is set the size n.
(self, n: int)
| 35 | _MAX_CAPACITY: int = 10 # Maximum capacity of cache |
| 36 | |
| 37 | def __init__(self, n: int) -> None: |
| 38 | """Creates an empty store and map for the keys. |
| 39 | The LRUCache is set the size n. |
| 40 | """ |
| 41 | self.dq_store = deque() |
| 42 | self.key_reference = set() |
| 43 | if not n: |
| 44 | LRUCache._MAX_CAPACITY = sys.maxsize |
| 45 | elif n < 0: |
| 46 | raise ValueError("n should be an integer greater than 0.") |
| 47 | else: |
| 48 | LRUCache._MAX_CAPACITY = n |
| 49 | |
| 50 | def refer(self, x: T) -> None: |
| 51 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected