Compare two sessions for equality.
(self, other: object)
| 86 | return f'<{self.__class__.__name__} {self.get_state(as_dict=False)}>' |
| 87 | |
| 88 | def __eq__(self, other: object) -> bool: |
| 89 | """Compare two sessions for equality.""" |
| 90 | if not isinstance(other, Session): |
| 91 | return NotImplemented |
| 92 | return self.get_state(as_dict=True) == other.get_state(as_dict=True) |
| 93 | |
| 94 | def __hash__(self) -> int: |
| 95 | """Return hash based on the session state.""" |