From 88292cf7d6231ccfe3177a698f6d5a01d78f01dc Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Tue, 3 Apr 2018 14:44:24 +0200 Subject: [PATCH] Implement __bool__ --- pyrogram/api/core/object.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyrogram/api/core/object.py b/pyrogram/api/core/object.py index a74eb876..24c1dcf1 100644 --- a/pyrogram/api/core/object.py +++ b/pyrogram/api/core/object.py @@ -37,6 +37,9 @@ class Object: def __str__(self) -> str: return dumps(self, cls=Encoder, indent=4) + def __bool__(self) -> bool: + return True + def __eq__(self, other) -> bool: return self.__dict__ == other.__dict__