Changes between Version 1 and Version 2 of Ticket #14471, comment 11


Ignore:
Timestamp:
04/22/13 20:29:18 (9 years ago)
Author:
nbruin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14471, comment 11

    v1 v2  
    3434 - there is a fix that apparently solves both problems
    3535 - there is something different in the problem originally reported here, since `keys()` seems to report an erroneous list.
     36
     37One difference between `data.keys()` and `__contains__` is that `dictobject.c/dict_keys` just iterates over the table storing the dict and extracts the keys of all dictentries that have a non-NULL value field, whereas `__contains__` will go through a `dictlookup`.
     38Given that some of the key components may well be in the process of being torn down, could it be that their hash is broken? One would still be able to find the corresponding key by iterating through all of them (as `wr.key in data.keys()` does), but finding it by hash would not work. Both `__contains__` and `__delitem__` would suffer from that.