Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #37074

Re: Any built-in ishashable method ?

From Peter Otten <__peter__@web.de>
Subject Re: Any built-in ishashable method ?
Date 2013-01-19 09:49 +0100
Organization None
References <kdbb94$hqa$1@ger.gmane.org> <627444785.6706139.1358510169194.JavaMail.root@sequans.com> <kdbdr4$7fl$1@ger.gmane.org> <50F94021.8030701@davea.name>
Newsgroups comp.lang.python
Message-ID <mailman.682.1358585369.2939.python-list@python.org> (permalink)

Show all headers | View raw


Dave Angel wrote:

> On 01/18/2013 07:06 AM, Peter Otten wrote:
>> Jean-Michel Pichavant wrote:
>>
>>> That brings me to another question, is there any valid test case where
>>> key1 != key2 and hash(key1) == hash(key2) ? Or is it some kind of design
>>> flaw ?
>>
>> I don't think there is a use case for such a behaviour other than
>> annoying your collegues ;)
>>
> 
> Beg to differ.  Nothing wrong with getting the same hash on objects that
> compare different.  It's called a hash collision, and is quite common,
> especially in large collections.

Of course.

> The problem is the converse of this, where the objects compare equal,
> but they have different hashes.

And that I read because my expectations won over the actual text.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Any built-in ishashable method ? Peter Otten <__peter__@web.de> - 2013-01-19 09:49 +0100

csiph-web