mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Add __eq__ and __hash__ methods to the Default class
This commit is contained in:
parent
9660c36889
commit
b7c9056fdd
1 changed files with 8 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue