Message150595
| Author |
loewis |
| Recipients |
alex, docs@python, jcea, loewis, pitrou, rhettinger, terry.reedy |
| Date |
2012年01月04日.08:17:41 |
| SpamBayes Score |
1.3009219e-06 |
| Marked as misclassified |
No |
| Message-id |
<4F040B24.7030403@v.loewis.de> |
| In-reply-to |
<1325644730.01.0.0342595612945.issue13707@psf.upfronthosting.co.za> |
| Content |
> 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. |
|