Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Any built-in ishashable method ?

Reply
Thread Tools

Re: Any built-in ishashable method ?

 
 
Dave Angel
Guest
Posts: n/a
 
      01-18-2013
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Any built-in ishashable method ? Steven D'Aprano Python 0 01-18-2013 12:16 PM
Re: Any built-in ishashable method ? Peter Otten Python 0 01-18-2013 12:06 PM
Re: Any built-in ishashable method ? Terry Reedy Python 0 01-18-2013 11:25 AM
Re: Any built-in ishashable method ? Peter Otten Python 0 01-18-2013 11:22 AM
Re: Any built-in ishashable method ? Dave Angel Python 0 01-18-2013 11:05 AM



Advertisments