Skip to content

Commit b931537

Browse files
added doctests to main()
1 parent b237fb3 commit b931537

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: other/lru_cache_pythonic.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,14 @@ def put(self, key:Hashable, value:Any)->None:
6363
self[key] = value
6464

6565
def main()->None:
66-
'''Example test case with LRU_Cache of size 2'''
66+
'''Example test case with LRU_Cache of size 2
67+
>>> main()
68+
1
69+
Key=2 not found in cache
70+
Key=1 not found in cache
71+
3
72+
4
73+
'''
6774
cache = LRUCache(2) # Creates an LRU cache with size 2
6875
cache.put(1,1) # cache = {1:1}
6976
cache.put(2,2) # cache = {1:1, 2:2}

0 commit comments

Comments
 (0)