Browse Source

Hashable

pull/10/head
Jure Šorn 6 years ago
parent
commit
2fd0723dc0
1 changed files with 1 additions and 1 deletions
  1. 2
      README.md

2
README.md

@ -718,7 +718,7 @@ class MyComparable:
### Hashable
* **Hashable object needs both hash() and eq() methods and it's hash value should never change.**
* **Objects that compare equal must have the same hash value, meaning default hash() that returns `'id(self)'` will not do.**
* **Hashable objects that compare equal must have the same hash value, meaning default hash() that returns `'id(self)'` will not do.**
* **That is why Python automatically makes classes unhashable if you only implement eq().**
```python

Loading…
Cancel
Save