On 2/6/20 2:13 PM, klau...@gmail.com wrote:
The default __eq__ method (object identity) is compatible with all (reasonable)
self-defined __hash__ method.
Stefan
If __eq__ compares just the id, then the only hash you need is the
default that is also the id. If you define a separate hash function,
which uses some of the 'value' of the object, then presumably you intend
for objects where that 'value' matches to be equal, which won't happen
with the default __eq__.
--
Richard Damon
--
https://mail.python.org/mailman/listinfo/python-list