Commit 305acf2f authored by Nick Coghlan's avatar Nick Coghlan

Remove an incorrect implementation detail

parent dc9b2555
...@@ -1262,16 +1262,11 @@ Basic customization ...@@ -1262,16 +1262,11 @@ Basic customization
immutable (if the object's hash value changes, it will be in the wrong hash immutable (if the object's hash value changes, it will be in the wrong hash
bucket). bucket).
User-defined classes have :meth:`__eq__` and :meth:`__hash__` methods User-defined classes have :meth:`__eq__` and :meth:`__hash__` methods
by default; with them, all objects compare unequal (except with themselves) by default; with them, all objects compare unequal (except with themselves)
and ``x.__hash__()`` returns an appropriate value such that ``x == y`` and ``x.__hash__()`` returns an appropriate value such that ``x == y``
implies both that ``x is y`` and ``hash(x) == hash(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 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 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 longer appropriate (e.g. by switching to a value-based concept of equality
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment