We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cecabe3 commit 9d16049Copy full SHA for 9d16049
1 file changed
other/lru_cache.py
@@ -2,6 +2,7 @@
2
3
from collections.abc import Callable
4
5
+
6
class DoubleLinkedListNode[T, U]:
7
"""
8
Double Linked List Node built specifically for LRU Cache
@@ -235,6 +236,7 @@ def __contains__(self, key: T) -> bool:
235
236
True
237
238
return key in self.cache
239
240
def get(self, key: T) -> U | None:
241
242
Returns the value for the input key and updates the Double Linked List.
@@ -309,6 +311,7 @@ def cache_decorator_wrapper(*args: T) -> U:
309
311
result = func(*args)
310
312
decorator_function_to_instance_map[func].put(args[0], result)
313
return result
314
315
def cache_info() -> LRUCache[T, U]:
316
return decorator_function_to_instance_map[func]
317
0 commit comments