On Fri, Jan 26, 2007, Giovanni Bajo wrote: > On 26/01/2007 17.03, Thomas Wouters wrote: >> >> There's no strict requirement that equal objects must have equal >> hashes, > > Uh? I thought that was the *only* strict requirement of hash. In fact > the docs agree: > > ==================================================== > __hash__( self) > > Called for the key object for dictionary operations, and by the built-in > function hash(). Should return a 32-bit integer usable as a hash value for > dictionary operations. The only required property is that objects which > compare equal have the same hash value; [...] > ==================================================== Possibly the docs should be updated, but this is only intended to apply to objects of the same type. > I personally consider *very* important that hash(5.0) == hash(5) (and > that 5.0 == 5, of course). Well, sure, but That's Different. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "I disrespectfully agree." --SJM
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4