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


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

Re: Any built-in ishashable method ?

Started byPeter Otten <__peter__@web.de>
First post2013-01-19 08:53 +0100
Last post2013-01-19 08:53 +0100
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 ? Peter Otten <__peter__@web.de> - 2013-01-19 08:53 +0100

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

FromPeter Otten <__peter__@web.de>
Date2013-01-19 08:53 +0100
SubjectRe: Any built-in ishashable method ?
Message-ID<mailman.674.1358582016.2939.python-list@python.org>
Kushal Kumaran wrote:

> Peter Otten <__peter__@web.de> writes:
> 
>> 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 ;)
>>
> 
> It's fairly common.  The set of possible keys can be much larger
> (possibly infinite) than the set of possible hash values (restricted to
> 32-bit or 64-bit integer values, afaict).

Sorry, I misread the quoted text. If you replace

key1 != key2 and hash(key1) == hash(key2)

in Jean-Michel's question with

key1 == key2 and hash(key1) != hash(key2)

my reply should start to make sense...

[toc] | [standalone]


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


csiph-web