[Python-checkins] cpython (2.7): note that the hash of an arbitrary object is only derived from its address

benjamin.peterson python-checkins at python.org
Fri Apr 4 15:59:56 CEST 2014


http://hg.python.org/cpython/rev/6809b434752a
changeset:   90133:6809b434752a
branch:      2.7
parent:      90123:b6deab7204e6
user:        Benjamin Peterson <benjamin at python.org>
date:        Fri Apr 04 09:58:13 2014 -0400
summary:
  note that the hash of an arbitrary object is only derived from its address (closes #21154)

Patch from Armin Rigo.

files:
  Doc/reference/datamodel.rst |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -1422,7 +1422,7 @@
 
    User-defined classes have :meth:`__cmp__` and :meth:`__hash__` methods
    by default; with them, all objects compare unequal (except with themselves)
-   and ``x.__hash__()`` returns ``id(x)``.
+   and ``x.__hash__()`` returns a result derived from ``id(x)``.
 
    Classes which inherit a :meth:`__hash__` method from a parent class but
    change the meaning of :meth:`__cmp__` or :meth:`__eq__` such that the hash

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list