Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: Dict when defining not returning multi value key error Date: Fri, 01 Aug 2014 18:39:30 +0300 Organization: A noiseless patient Spider Lines: 20 Message-ID: <87vbqcnrrh.fsf@elektro.pacujo.net> References: <53db11c1$0$29986$c3e8da3$5496439d@news.astraweb.com> <53db96bc$0$29986$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx05.eternal-september.org; posting-host="ff5cf27ef3d5b31f034d3b72bdc27a41"; logging-data="20322"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/0QbZkfXLXpAgyEbmXdUTx" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:xwQNhlUvCLYL5J3IAflZmuBqm/Q= sha1:yCRtmK2BI/BqvizJ/2xp6bB6frE= Xref: csiph.com comp.lang.python:75487 Chris Angelico : >> 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