Skip to content

Commit 8bbcb9d

Browse files
bdlucas1mmatera
andauthored
Apply suggestions from code review
Use id(value) for hash Co-authored-by: Juan Mauricio Matera <[email protected]>
1 parent 579e234 commit 8bbcb9d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mathics/core/atoms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ def __init__(self, value, dtype=None):
11581158
def __hash__(self):
11591159
if not self._hash:
11601160
self._hash = hash(
1161-
("NumericArray", self.value.shape, self.value.tobytes()[:100])
1161+
("NumericArray", self.value.shape, id(self.value))
11621162
)
11631163
return self._hash
11641164

@@ -1189,7 +1189,7 @@ def element_order(self) -> tuple:
11891189
BASIC_ATOM_NUMERICARRAY_ELT_ORDER,
11901190
self.value.shape,
11911191
self.value.dtype,
1192-
self.value.tobytes(),
1192+
id(self.value),
11931193
)
11941194

11951195
@property

0 commit comments

Comments
 (0)