Dict when defining not returning multi value key error

Marko Rauhamaa marko at pacujo.net
Fri Aug 1 11:39:30 EDT 2014


Chris Angelico <rosuav at gmail.com>:

>> but hash(x) == hash(y) does NOT imply that x == y.
>
> Hello, pigeonhole principle :) If this were false - that is, if equal
> hashes DID imply equal objects - it would be necessary to completely
> encode an object's state in its hash, and hashes would be impossibly
> large. This would, in fact, destroy their value completely.

Well, modern computing assumes precisely:

   hash(x) == hash(y) => x == y

That principle is at play with strong authentication (HTTPS et al),
version control (git et al),

A handful of bits uniquely identify an object regardless of its size.


Marko



More information about the Python-list mailing list