Browse Source

Hashable

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

2
README.md

@ -649,7 +649,7 @@ class MyComparable:
```
### Hashable
**Hashable object needs both hash() and eq() methods and it's hash value should not change. 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().**
**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. That is why Python automatically makes classes unhashable if you only implement eq().**
```python
class MyHashable:

Loading…
Cancel
Save