diff --git a/mypy.ini b/mypy.ini index f00b3eeb6bac..927ad0f89586 100644 --- a/mypy.ini +++ b/mypy.ini @@ -2,4 +2,4 @@ ignore_missing_imports = True install_types = True non_interactive = True -exclude = (other/least_recently_used.py|other/lfu_cache.py|other/lru_cache.py) +exclude = (other/lfu_cache.py|other/lru_cache.py) diff --git a/other/least_recently_used.py b/other/least_recently_used.py index d0e27efc6dc8..302a06c1fd3b 100644 --- a/other/least_recently_used.py +++ b/other/least_recently_used.py @@ -1,16 +1,17 @@ import sys -from abc import abstractmethod +from abc import ABCMeta from collections import deque class LRUCache: """Page Replacement Algorithm, Least Recently Used (LRU) Caching.""" + __metaclass__ = ABCMeta + dq_store = object() # Cache store of keys key_reference_map = object() # References of the keys in cache _MAX_CAPACITY: int = 10 # Maximum capacity of cache - @abstractmethod def __init__(self, n: int): """Creates an empty store and map for the keys. The LRUCache is set the size n.