Skip to content

Commit 8f948d1

Browse files
try removing "fast" hash
1 parent 7017514 commit 8f948d1

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

python/egglog/declarations.py

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from __future__ import annotations
88

99
from dataclasses import dataclass, field
10-
from functools import cached_property
1110
from typing import TYPE_CHECKING, Literal, Protocol, TypeAlias, TypeVar, Union, runtime_checkable
1211

1312
from typing_extensions import Self, assert_never
@@ -575,24 +574,24 @@ def __post_init__(self) -> None:
575574
msg = "Cannot bind type parameters to a non-class method callable."
576575
raise ValueError(msg)
577576

578-
def __hash__(self) -> int:
579-
return self._cached_hash
580-
581-
@cached_property
582-
def _cached_hash(self) -> int:
583-
return hash((self.callable, self.args, self.bound_tp_params))
584-
585-
def __eq__(self, other: object) -> bool:
586-
# Override eq to use cached hash for perf
587-
if not isinstance(other, CallDecl):
588-
return False
589-
if hash(self) != hash(other):
590-
return False
591-
return (
592-
self.callable == other.callable
593-
and self.args == other.args
594-
and self.bound_tp_params == other.bound_tp_params
595-
)
577+
# def __hash__(self) -> int:
578+
# return self._cached_hash
579+
580+
# @cached_property
581+
# def _cached_hash(self) -> int:
582+
# return hash((self.callable, self.args, self.bound_tp_params))
583+
584+
# def __eq__(self, other: object) -> bool:
585+
# # Override eq to use cached hash for perf
586+
# if not isinstance(other, CallDecl):
587+
# return False
588+
# if hash(self) != hash(other):
589+
# return False
590+
# return (
591+
# self.callable == other.callable
592+
# and self.args == other.args
593+
# and self.bound_tp_params == other.bound_tp_params
594+
# )
596595

597596

598597
@dataclass(frozen=True)

0 commit comments

Comments
 (0)