Skip to content

Commit 5727449

Browse files
committed
Hashable
1 parent 7b02b5b commit 5727449

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ class Employee(Person):
636636
```
637637

638638
### Comparable
639-
**If eq() method is not overriden, it returns `id(self) == id(other)`, which is the same as `self is other`, meaning all objects compare not equal by default.**
639+
**If eq() method is not overriden, it returns `'id(self) == id(other)'`, which is the same as `'self is other'`, meaning all objects compare not equal by default.**
640640

641641
```python
642642
class MyComparable:
@@ -649,7 +649,7 @@ class MyComparable:
649649
```
650650

651651
### Hashable
652-
**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().**
652+
**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().**
653653

654654
```python
655655
class MyHashable:

0 commit comments

Comments
 (0)