(self)
| 1631 | d.get(key2) |
| 1632 | |
| 1633 | def test_clear_at_lookup(self): |
| 1634 | # gh-140551 dict crash if clear is called at lookup stage |
| 1635 | class X: |
| 1636 | def __hash__(self): |
| 1637 | return 1 |
| 1638 | def __eq__(self, other): |
| 1639 | nonlocal d |
| 1640 | d.clear() |
| 1641 | |
| 1642 | d = {} |
| 1643 | for _ in range(10): |
| 1644 | d[X()] = None |
| 1645 | |
| 1646 | self.assertEqual(len(d), 1) |
| 1647 | |
| 1648 | d = {} |
| 1649 | for _ in range(10): |
| 1650 | d.setdefault(X(), None) |
| 1651 | |
| 1652 | self.assertEqual(len(d), 1) |
| 1653 | |
| 1654 | def test_split_table_update_with_str_subclass(self): |
| 1655 | # gh-142218: inserting into a split table dictionary with a non str |
nothing calls this directly
no test coverage detected