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


Groups > comp.lang.python > #37072 > unrolled thread

Re: Any built-in ishashable method ?

Started byDave Angel <d@davea.name>
First post2013-01-18 07:29 -0500
Last post2013-01-18 07:29 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Any built-in ishashable method ? Dave Angel <d@davea.name> - 2013-01-18 07:29 -0500

#37072 — Re: Any built-in ishashable method ?

FromDave Angel <d@davea.name>
Date2013-01-18 07:29 -0500
SubjectRe: Any built-in ishashable method ?
Message-ID<mailman.681.1358584747.2939.python-list@python.org>
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.

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

-- 
DaveA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web