Skip to content

Commit 432474a

Browse files
committed
Fix
1 parent 2a9b649 commit 432474a

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

other/lfu_cache.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
from collections.abc import Callable
4-
from typing import ClassVar, Generic, TypeVar
4+
from typing import Generic, TypeVar
55

66
T = TypeVar("T")
77
U = TypeVar("U")
@@ -197,9 +197,8 @@ class LFUCache(Generic[T, U]):
197197
"""
198198

199199
# class variable to map the decorator functions to their respective instance
200-
decorator_function_to_instance_map: ClassVar[ # type: ignore[misc]
201-
dict[Callable[[T], U], LFUCache[T, U]]
202-
] = {}
200+
decorator_function_to_instance_map: dict[Callable[[T], U], LFUCache[T, U]] = {} # noqa: RUF012
201+
203202

204203
def __init__(self, capacity: int):
205204
self.list: DoubleLinkedList[T, U] = DoubleLinkedList()

other/lru_cache.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
from collections.abc import Callable
4-
from typing import ClassVar, Generic, TypeVar
4+
from typing import Generic, TypeVar
55

66
T = TypeVar("T")
77
U = TypeVar("U")
@@ -210,9 +210,7 @@ class LRUCache(Generic[T, U]):
210210
"""
211211

212212
# class variable to map the decorator functions to their respective instance
213-
decorator_function_to_instance_map: ClassVar[ # type: ignore[misc]
214-
dict[Callable[[T], U], LRUCache[T, U]]
215-
] = {}
213+
decorator_function_to_instance_map: dict[Callable[[T], U], LRUCache[T, U]] = {} # noqa: RUF012
216214

217215
def __init__(self, capacity: int):
218216
self.list: DoubleLinkedList[T, U] = DoubleLinkedList()

0 commit comments

Comments
 (0)