From 57a489747062e571eb33f95e8df5660f6cf274f8 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 24 Apr 2022 11:56:07 +0200 Subject: [PATCH] Skip attributes with leading underscore in Object.__eq__ --- pyrogram/types/object.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyrogram/types/object.py b/pyrogram/types/object.py index 9e2c684b..28bee9a7 100644 --- a/pyrogram/types/object.py +++ b/pyrogram/types/object.py @@ -88,6 +88,9 @@ class Object: def __eq__(self, other: "Object") -> bool: for attr in self.__dict__: try: + if attr.startswith("_"): + continue + if getattr(self, attr) != getattr(other, attr): return False except AttributeError: