Skip to content

Commit 3829d69

Browse files
Merge pull request #245 from Pusty/calldeclfix
CallDecl __eq__ Fix
2 parents 8b17580 + c0a1565 commit 3829d69

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ build-backend = "maturin"
66
name = "egglog"
77
description = "e-graphs in Python built around the the egglog rust library"
88
readme = "README.md"
9+
dynamic = ["version"]
910
license = { text = "MIT" }
1011
requires-python = ">=3.10"
1112
classifiers = [

python/egglog/declarations.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,13 @@ def __eq__(self, other: object) -> bool:
573573
# Override eq to use cached hash for perf
574574
if not isinstance(other, CallDecl):
575575
return False
576-
return hash(self) == hash(other)
576+
if hash(self) != hash(other):
577+
return False
578+
return (
579+
self.callable == other.callable
580+
and self.args == other.args
581+
and self.bound_tp_params == other.bound_tp_params
582+
)
577583

578584

579585
@dataclass(frozen=True)

0 commit comments

Comments
 (0)