From 80c06c56f7316c16cf748bdd0eb301f686e062e7 Mon Sep 17 00:00:00 2001 From: NextChai <75498301+NextChai@users.noreply.github.com> Date: Sat, 30 Apr 2022 02:39:37 -0400 Subject: [PATCH] Refactor cache.py to fix _BaseCache --- Github/cache.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Github/cache.py b/Github/cache.py index f3e88f1..0a8dc3f 100644 --- a/Github/cache.py +++ b/Github/cache.py @@ -2,8 +2,7 @@ from __future__ import annotations -from collections import deque -from collections.abc import MutableMapping +from collections import deque, UserDict from typing import Any, Deque, Tuple, TypeVar __all__: Tuple[str, ...] = ('ObjectCache',) @@ -13,7 +12,7 @@ K = TypeVar('K') V = TypeVar('V') -class _BaseCache(MutableMapping[K, V]): +class _BaseCache(UserDict[K, V]): """This is a rough implementation of an LRU Cache using a deque and a dict.""" __slots__: Tuple[str, ...] = ('_max_size', '_lru_keys')