From b6dcd1b55d9dbb4492c32440389fd9659fb334ca Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Thu, 20 Apr 2023 21:50:46 -0500
Subject: [PATCH] Type cache key as hashable

---
 pytato/transform/__init__.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pytato/transform/__init__.py b/pytato/transform/__init__.py
index cd5bb16..23898a3 100644
--- a/pytato/transform/__init__.py
+++ b/pytato/transform/__init__.py
@@ -183,9 +183,9 @@ class CachedMapper(Mapper, Generic[CachedMapperT]):
     """
 
     def __init__(self) -> None:
-        self._cache: Dict[Any, CachedMapperT] = {}
+        self._cache: Dict[Hashable, CachedMapperT] = {}
 
-    def get_cache_key(self, expr: ArrayOrNames) -> Any:
+    def get_cache_key(self, expr: ArrayOrNames) -> Hashable:
         return expr
 
     # type-ignore-reason: incompatible with super class
@@ -389,7 +389,7 @@ class CopyMapperWithExtraArgs(CachedMapper[ArrayOrNames]):
                                 Tuple[Any, ...],
                                 Tuple[Tuple[str, Any], ...]
                                 ],
-                          ArrayOrNames] = {}
+                          ArrayOrNames] = {}  # type: ignore[assignment]
 
     def get_cache_key(self,
                       expr: ArrayOrNames,
-- 
GitLab