Skip to content

Commit 23c8c2d

Browse files
committed
misc: Don't try to catch unhashable args
1 parent 060370d commit 23c8c2d

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

devito/tools/memoization.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ def __call__(self, obj: InstanceType,
6666
"""
6767
Invokes the memoized method, caching the result if it hasn't been evaluated yet.
6868
"""
69-
# If arguments are not hashable, just evaluate the method directly
70-
if not isinstance(args, Hashable):
71-
return self._meth(obj, *args, **kwargs)
72-
7369
# Get the local cache for the object instance
7470
cache = self._get_cache(obj)
7571
key = (self._meth, args, frozenset(kwargs.items()))
@@ -199,10 +195,6 @@ def __call__(self, obj: InstanceType,
199195
"""
200196
Invokes the memoized generator, caching a SafeTee if it hasn't been created yet.
201197
"""
202-
# If arguments are not hashable, just evaluate the method directly
203-
if not isinstance(args, Hashable):
204-
return self._meth(obj, *args, **kwargs)
205-
206198
# Get the local cache for the object instance
207199
cache = self._get_cache(obj)
208200
key = (self._meth, args, frozenset(kwargs.items()))

0 commit comments

Comments
 (0)