mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-26 03:13:45 +03:00
Override TLObject's __eq__ and __ne__ methods
This commit is contained in:
parent
add122bfe7
commit
fbd53e2126
|
@ -144,6 +144,12 @@ class TLObject:
|
|||
def on_response(self, reader):
|
||||
self.result = reader.tgread_object()
|
||||
|
||||
def __eq__(self, o):
|
||||
return isinstance(o, type(self)) and self.to_dict() == o.to_dict()
|
||||
|
||||
def __ne__(self, o):
|
||||
return not isinstance(o, type(self)) or self.to_dict() != o.to_dict()
|
||||
|
||||
def __str__(self):
|
||||
return TLObject.pretty_format(self)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user