2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-28 12:57:52 +00:00

Skip attributes with leading underscore in Object.__eq__

This commit is contained in:
Dan 2022-04-24 11:56:07 +02:00
parent 20c6b959d5
commit 57a4897470

View File

@ -88,6 +88,9 @@ class Object:
def __eq__(self, other: "Object") -> bool: def __eq__(self, other: "Object") -> bool:
for attr in self.__dict__: for attr in self.__dict__:
try: try:
if attr.startswith("_"):
continue
if getattr(self, attr) != getattr(other, attr): if getattr(self, attr) != getattr(other, attr):
return False return False
except AttributeError: except AttributeError: