Add __eq__ and __hash__ methods to the Default class

This commit is contained in:
Aleksandr Zainulgabidinov 2026-03-23 09:18:20 +03:00
parent 9660c36889
commit b7c9056fdd

View file

@ -28,6 +28,14 @@ class Default:
def __repr__(self) -> str:
return f"<{self}>"
def __eq__(self, other: object) -> bool:
if not isinstance(other, Default):
return NotImplemented
return self._name == other._name
def __hash__(self) -> int:
return hash(self._name)
@dataclass(**dataclass_kwargs(slots=True, kw_only=True))
class DefaultBotProperties: