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:
parent
20c6b959d5
commit
57a4897470
@ -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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user