Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cirq-core/cirq/value/value_equality_attr.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ def _value_equality_values_cls_(self) -> Any:


def _value_equality_eq(self: _SupportsValueEquality, other: _SupportsValueEquality) -> bool:
if other is self:
return True
cls_self = self._value_equality_values_cls_()
get_cls_other = getattr(other, '_value_equality_values_cls_', None)
if get_cls_other is None:
Expand All @@ -91,6 +93,8 @@ def _value_equality_hash(self: _SupportsValueEquality) -> int:
def _value_equality_approx_eq(
self: _SupportsValueEquality, other: _SupportsValueEquality, atol: float
) -> bool:
if other is self:
return True
cls_self = self._value_equality_values_cls_()
get_cls_other = getattr(other, '_value_equality_values_cls_', None)
if get_cls_other is None:
Expand Down