"Adam Olsen" <[EMAIL PROTECTED]> wrote: > So there you have it: if you're using a dict with custom classes (or > anything other than str) across multiple threads, and without locking > it, it's possible (though presumably extremely rare) for a lookup to > fail even through the key was there the entire time.
Nice work. It would be an interesting exercise to demonstrate this in practice, and I think it should be possible without resorting to threads (by putting something to simulate what the other thread would do into the __cmp__ method). I don't understand your reasoning which says it cannot stay in ma_smalltable: PyDict_SetItem only calls dictresize when at least 2/3 of the slots are filled. You can have 5 items in the small (8 slot) table and the dictionary will resize to 32 slots on adding the 6th,the next resize comes when you add the 22nd item. -- http://mail.python.org/mailman/listinfo/python-list