MCPcopy Create free account
hub / github.com/apache/tvm-ffi / _PyEqHash

Class _PyEqHash

tests/python/test_dataclass_compare.py:1294–1302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1292
1293@_py_class_cmp(_unique_key_cmp("PyEqHash"))
1294class _PyEqHash(_Object_cmp):
1295 key: int
1296 label: str
1297
1298 def __ffi_hash__(self, fn_hash: _Callable_cmp[..., _Any_cmp]) -> int:
1299 return fn_hash(self.key)
1300
1301 def __ffi_eq__(self, other: _PyEqHash, fn_eq: _Callable_cmp[..., _Any_cmp]) -> bool:
1302 return fn_eq(self.key, other.key)
1303
1304
1305@_py_class_cmp(_unique_key_cmp("PyCmp"))

Calls

no outgoing calls