Commit b41299e4 authored by Benjamin Peterson's avatar Benjamin Peterson

note that the hash of an arbitrary object is only derived from its address (closes #21154)

Patch from Armin Rigo.
parent 66d8dbea
......@@ -1422,7 +1422,7 @@ Basic customization
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
......
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