zhemao/funktown — Issue #2: Hash collisions not handled properly
Author: halgari
Created: 2012-02-22 15:13:02+00:00
State: open

>>> d = funktown.ImmutableDict()
>>> d.assoc("1", "string")
ImmutableDict({'1': 'string'})
>>> d.assoc("1", "string").assoc(1877051568, "int")
ImmutableDict({1877051568: 'int', '1': 'string'})
>>> d.assoc("1", "string").assoc(1977051568, "int")
ImmutableDict({1977051568: 'int'})
>>>

Since "1" and 1977051568 have the same hash values, the one wipes out the other. The Clojure hash map is a bit more involved, but handles this situation properly.