Skip to content

Commit 42f8de8

Browse files
committed
ensure ArrayContext is not hashable
1 parent 8b4e2f2 commit 42f8de8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arraycontext/context.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,9 @@ def _get_fake_numpy_namespace(self) -> Any:
286286
from .fake_numpy import BaseFakeNumpyNamespace
287287
return BaseFakeNumpyNamespace(self)
288288

289+
def __hash__(self) -> int:
290+
raise TypeError(f"unhashable type: '{type(self).__name__}'")
291+
289292
@abstractmethod
290293
def empty(self,
291294
shape: Union[int, Tuple[int, ...]],

0 commit comments

Comments
 (0)