[Python-Dev] Python's C interface for types (original) (raw)
Giovanni Bajo rasky at develer.com
Fri Jan 26 20:27:14 CET 2007
- Previous message: [Python-Dev] Python's C interface for types
- Next message: [Python-Dev] Python's C interface for types
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 26/01/2007 17.03, Thomas Wouters wrote:
How critical is the 'numeric' property of the nbhash function? I can certainly honour it, but is it worth it?
[...] 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; [...]
I personally consider very important that hash(5.0) == hash(5) (and that 5.0 == 5, of course).
Giovanni Bajo
- Previous message: [Python-Dev] Python's C interface for types
- Next message: [Python-Dev] Python's C interface for types
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]