From 5430bd0b804eec2d8bce0f3765c123a870912e2f Mon Sep 17 00:00:00 2001 From: Rohan R Bharadwaj Date: Thu, 11 Nov 2021 04:53:25 +0530 Subject: [PATCH 1/3] Update least_recently_used.py --- other/least_recently_used.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/other/least_recently_used.py b/other/least_recently_used.py index 9d6b6d7cb6a6..754b5561cd93 100644 --- a/other/least_recently_used.py +++ b/other/least_recently_used.py @@ -1,10 +1,13 @@ import sys +from abc import ABCMeta from collections import deque -class LRUCache: +class LRUCache(object): """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 From 3bdc556fcf7bb24ed82c430b2334917562e1bdf3 Mon Sep 17 00:00:00 2001 From: Rohan R Bharadwaj Date: Thu, 11 Nov 2021 04:53:42 +0530 Subject: [PATCH 2/3] Update mypy.ini --- mypy.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/mypy.ini b/mypy.ini index 7dbc7c4ffc80..de473bbb2bc6 100644 --- a/mypy.ini +++ b/mypy.ini @@ -2,4 +2,3 @@ ignore_missing_imports = True install_types = True non_interactive = True -exclude = (other/least_recently_used.py) From 5f84d1b4c973f082c1f5c9ee81cd71c6b8193bd7 Mon Sep 17 00:00:00 2001 From: Rohan R Bharadwaj Date: Thu, 11 Nov 2021 05:02:23 +0530 Subject: [PATCH 3/3] formatting --- other/least_recently_used.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/other/least_recently_used.py b/other/least_recently_used.py index 754b5561cd93..302a06c1fd3b 100644 --- a/other/least_recently_used.py +++ b/other/least_recently_used.py @@ -3,7 +3,7 @@ from collections import deque -class LRUCache(object): +class LRUCache: """Page Replacement Algorithm, Least Recently Used (LRU) Caching.""" __metaclass__ = ABCMeta