Skip to content

Commit

Permalink
Merge pull request #245 from Pusty/calldeclfix
Browse files Browse the repository at this point in the history
CallDecl __eq__ Fix
  • Loading branch information
saulshanabrook authored Dec 20, 2024
2 parents 8b17580 + c0a1565 commit 3829d69
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ build-backend = "maturin"
name = "egglog"
description = "e-graphs in Python built around the the egglog rust library"
readme = "README.md"
dynamic = ["version"]
license = { text = "MIT" }
requires-python = ">=3.10"
classifiers = [
Expand Down
8 changes: 7 additions & 1 deletion python/egglog/declarations.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,13 @@ def __eq__(self, other: object) -> bool:
# Override eq to use cached hash for perf
if not isinstance(other, CallDecl):
return False
return hash(self) == hash(other)
if hash(self) != hash(other):
return False
return (
self.callable == other.callable
and self.args == other.args
and self.bound_tp_params == other.bound_tp_params
)


@dataclass(frozen=True)
Expand Down

0 comments on commit 3829d69

Please sign in to comment.