order independent hash?
Ian Kelly
ian.g.kelly at gmail.com
Sun Dec 4 18:24:49 EST 2011
On Sun, Dec 4, 2011 at 4:17 PM, 88888 Dihedral
<dihedral88888 at googlemail.com> wrote:
>> Please explain what you think a hash function is, then. Per
>> Wikipedia, "A hash function is any algorithm or subroutine that maps
>> large data sets to smaller data sets, called keys."
>>
>> > Are you miss-leading the power of true OOP ?
>>
>> I have no idea what you are suggesting. I was not talking about OOP at all.
>
> In python the (k,v) pair in a dictionary k and v can be both an objects.
> v can be a tuple or a list. There are some restrictions on k to be an
> hashable type in python's implementation. The key is used to compute the position of the pair to be stored in a hash table. The hash function maps key k to the position in the hash table. If k1!=k2 are both mapped to the same
> position, then something has to be done to resolve this.
I understand how dicts / hash tables work. I don't need you to
explain that to me. What you haven't explained is why you stated that
a hash function that operates on objects is not a hash function, or
what you meant by "misleading the power of true OOP".
More information about the Python-list
mailing list