- "I'm still not sure to get it, who is calling `data[i] = new`, ie., is it supposed to be a normal use of your object? If it is, then why is it? If it's not then just prevent accessing `__setitem__` on your heap. To me `data[i] = new` looks like an attack on your heap. If you really need to deal with this, then sorting your heap every time someone is attacking it seems perfectly fine to me. You could even do this in a lazier fashion, resorting only if someone is using normal heap methods. In any case your attacker code `data.index(old)` is so slow that any strategy will do. "
0 commit comments