| 1304 | |
| 1305 | @_py_class_cmp(_unique_key_cmp("PyCmp")) |
| 1306 | class _PyCmp(_Object_cmp): |
| 1307 | key: int |
| 1308 | label: str |
| 1309 | |
| 1310 | def __ffi_hash__(self, fn_hash: _Callable_cmp[..., _Any_cmp]) -> int: |
| 1311 | return fn_hash(self.key) |
| 1312 | |
| 1313 | def __ffi_eq__(self, other: _PyCmp, fn_eq: _Callable_cmp[..., _Any_cmp]) -> bool: |
| 1314 | return fn_eq(self.key, other.key) |
| 1315 | |
| 1316 | def __ffi_compare__(self, other: _PyCmp, fn_cmp: _Callable_cmp[..., _Any_cmp]) -> int: |
| 1317 | return fn_cmp(self.key, other.key) |
| 1318 | |
| 1319 | |
| 1320 | def test_py_class_custom_eq_ignores_label() -> None: |
no outgoing calls