Skip to content

Commit eea84ed

Browse files
committed
Fix some RUF012 per file ignores
1 parent 1e66d4b commit eea84ed

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

other/lfu_cache.py

+2-2
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 Generic, TypeVar
4+
from typing import ClassVar, Generic, TypeVar
55

66
T = TypeVar("T")
77
U = TypeVar("U")
@@ -197,7 +197,7 @@ 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: dict[Callable[[T], U], LFUCache[T, U]] = {}
200+
decorator_function_to_instance_map: ClassVar[dict[Callable[[T], U], LFUCache[T, U]]] = {}
201201

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

other/lru_cache.py

+2-2
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 Generic, TypeVar
4+
from typing import ClassVar, Generic, TypeVar
55

66
T = TypeVar("T")
77
U = TypeVar("U")
@@ -210,7 +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: dict[Callable[[T], U], LRUCache[T, U]] = {}
213+
decorator_function_to_instance_map: ClassVar[dict[Callable[[T], U], LRUCache[T, U]]] = {}
214214

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

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ max-complexity = 17 # default: 10
8585
"machine_learning/decision_tree.py" = ["SIM114"]
8686
"machine_learning/sequential_minimum_optimization.py" = ["SIM115"]
8787
"matrix/sherman_morrison.py" = ["SIM103", "SIM114"]
88-
"other/l*u_cache.py" = ["RUF012"]
8988
"physics/newtons_second_law_of_motion.py" = ["BLE001"]
9089
"project_euler/problem_099/sol1.py" = ["SIM115"]
9190
"sorts/external_sort.py" = ["SIM115"]

0 commit comments

Comments
 (0)