4 Jan
2012
4 Jan
'12
8:17 a.m.
Martin v. Löwis <martin@v.loewis.de> added the comment:
Martin, I do not understand. The default hash is based on id (as is default equality comparison), not value.
In the default implementation, the id *is* the object's value (i.e. objects, by default, only compare equal if they are identical). So the default implementation is just a special case of the more general rule that hashes need to be consistent with equality.
Are you OK with hash values changing if the 'value' changes?
An object that can change its value (i.e. a mutable object) should fail to hash. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13707> _______________________________________