Skip to content

Commit 63c93a7

Browse files
committed
Declare Variable to be unhashable
The appropriate place to do this seems to be beside the definition of `__eq__` since defining `__eq__` without `__hash__` renders an object unhashable. For a reference to how types are marked as non-hashable, see <https://github.com/python/typeshed/pull/3219/files>
1 parent bb489fa commit 63c93a7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

xarray/core/_typed_ops.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,8 @@ def __eq__(self, other: VarCompatible) -> Self:
632632
def __eq__(self, other: VarCompatible) -> Self | T_DataArray:
633633
return self._binary_op(other, nputils.array_eq)
634634

635+
__hash__: None # type:ignore[assignment]
636+
635637
@overload # type:ignore[override]
636638
def __ne__(self, other: T_DataArray) -> T_DataArray:
637639
...

0 commit comments

Comments
 (0)