>>> WordCount('a', 1).__eq__(WordCount('b', 1)) True >>> WordCount('a', 1).__eq__(WordCount('a', 1)) True >>> WordCount('a', 1).__eq__(WordCount('a', 2)) False >>> WordCount('a', 1).__eq__(WordCount('b', 2)) False >>> WordCount
(self, other: object)
| 26 | self.count = count |
| 27 | |
| 28 | def __eq__(self, other: object) -> bool: |
| 29 | """ |
| 30 | >>> WordCount('a', 1).__eq__(WordCount('b', 1)) |
| 31 | True |
| 32 | >>> WordCount('a', 1).__eq__(WordCount('a', 1)) |
| 33 | True |
| 34 | >>> WordCount('a', 1).__eq__(WordCount('a', 2)) |
| 35 | False |
| 36 | >>> WordCount('a', 1).__eq__(WordCount('b', 2)) |
| 37 | False |
| 38 | >>> WordCount('a', 1).__eq__(1) |
| 39 | NotImplemented |
| 40 | """ |
| 41 | if not isinstance(other, WordCount): |
| 42 | return NotImplemented |
| 43 | return self.count == other.count |
| 44 | |
| 45 | def __lt__(self, other: object) -> bool: |
| 46 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected