| 1485 | eq_count = 0 |
| 1486 | # This class compares equal to the string 'key3' |
| 1487 | class Key3: |
| 1488 | def __hash__(self): |
| 1489 | return hash('key3') |
| 1490 | |
| 1491 | def __eq__(self, other): |
| 1492 | nonlocal eq_count |
| 1493 | if isinstance(other, Key3) or isinstance(other, str) and other == 'key3': |
| 1494 | eq_count += 1 |
| 1495 | return True |
| 1496 | return False |
| 1497 | |
| 1498 | key3_1 = StrSub('key3') |
| 1499 | key3_2 = Key3() |
no outgoing calls