(self)
| 921 | d[i] = i |
| 922 | |
| 923 | def test_resize2(self): |
| 924 | # Another dict resizing bug (SF bug #1456209). |
| 925 | # This caused Segmentation faults or Illegal instructions. |
| 926 | |
| 927 | class X(object): |
| 928 | def __hash__(self): |
| 929 | return 5 |
| 930 | def __eq__(self, other): |
| 931 | if resizing: |
| 932 | d.clear() |
| 933 | return False |
| 934 | d = {} |
| 935 | resizing = False |
| 936 | d[X()] = 1 |
| 937 | d[X()] = 2 |
| 938 | d[X()] = 3 |
| 939 | d[X()] = 4 |
| 940 | d[X()] = 5 |
| 941 | # now trigger a resize |
| 942 | resizing = True |
| 943 | d[9] = 6 |
| 944 | |
| 945 | def test_empty_presized_dict_in_freelist(self): |
| 946 | # Bug #3537: if an empty but presized dict with a size larger |