>>>>> "MH" == Michael Hudson <mwh21@cam.ac.uk> writes: MH> Jeremy Hylton <jeremy@alum.mit.edu> writes: >> >>>>> "MWH" == Michael Hudson <mwh21@cam.ac.uk> writes: >> MWH> [*] I thought that if you used the same keys when you were MWH> iterating over a dict you were safe. It seems not, at least as MWH> far as I could tell with mounds of debugging printf's. >> >> I did, too. Anyone know what the problems is? MH> The dict's resizing, it turns out. So a hack to make the iteration safe would be to assign and element and then delete it? MH> I note that in PyDict_SetItem, the check to see if the dict MH> needs resizing occurs *before* it is known whether the key is MH> already in the dict. But if this is the problem, how come we MH> haven't been bitten by this before? It's probably unusual for a dictionary to be in this state when the compiler decides to update the values. Jeremy
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4