[Python-checkins] cpython: Remove an incorrect implementation detail
nick.coghlan
python-checkins at python.org
Sun May 20 13:22:45 CEST 2012
http://hg.python.org/cpython/rev/6195c7397d9e
changeset: 77085:6195c7397d9e
user: Nick Coghlan <ncoghlan at gmail.com>
date: Sun May 20 21:22:27 2012 +1000
summary:
Remove an incorrect implementation detail
files:
Doc/reference/datamodel.rst | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -1262,16 +1262,11 @@
immutable (if the object's hash value changes, it will be in the wrong hash
bucket).
-
User-defined classes have :meth:`__eq__` and :meth:`__hash__` methods
by default; with them, all objects compare unequal (except with themselves)
and ``x.__hash__()`` returns an appropriate value such that ``x == y``
implies both that ``x is y`` and ``hash(x) == hash(y)``.
- .. impl-detail::
-
- CPython uses ``hash(id(x))`` as the default hash for class instances.
-
Classes which inherit a :meth:`__hash__` method from a parent class but
change the meaning of :meth:`__eq__` such that the hash value returned is no
longer appropriate (e.g. by switching to a value-based concept of equality
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list