Skip to content

Commit

Permalink
add assertion to check for double caching
Browse files Browse the repository at this point in the history
  • Loading branch information
majosm committed Feb 27, 2025
1 parent 99b1d47 commit 9bc0a14
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pytato/transform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,9 @@ def add(
else:
key = self.get_key(key_inputs)

assert key not in self._expr_key_to_result, \
f"Cache entry is already present for key '{key}'."

self._expr_key_to_result[key] = result

return result
Expand Down

0 comments on commit 9bc0a14

Please sign in to comment.