weird dict problem, how can this even happen?

Scott David Daniels Scott.Daniels at Acm.Org
Fri Dec 19 15:48:31 EST 2008


Joel Hedlund wrote:
> Scott David Daniels wrote:
>> Perhaps your hash function could be something like:
> 
> I'm not sure I understand what you're suggesting.
> 
> /Joel

Sorry, a half-thought out idea based on the fact that you wanted a
consistent hash for a varying dictionary.  The given dictionary subclass
does have a consistent hash, so it should be able to find itself.

Of course solving the consistent hash without any more work doesn't
succeed in general and, without major changes, it makes for exponential
lookups (lookup with all keys elements and drop parts til found).

Perhaps separating the key (unchanging) from the to-be-varied part of
the entry might work for some data sources, and the singly calculated
hash might help.

Sorry for a confusing post without much to recommend it.

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list