From 7963af1d177c435072774db204367788d3959cef Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Mon, 16 May 2022 09:36:13 +0200 Subject: [PATCH] Add repr to updates session types for easier debugging --- telethon/_updates/session.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/telethon/_updates/session.py b/telethon/_updates/session.py index 99577c1d..5025dd38 100644 --- a/telethon/_updates/session.py +++ b/telethon/_updates/session.py @@ -41,6 +41,9 @@ class SessionState: self.seq = seq self.takeout_id = takeout_id + def __repr__(self): + return repr({k: getattr(self, k) for k in self.__slots__}) + class ChannelState: """ @@ -59,6 +62,9 @@ class ChannelState: self.channel_id = channel_id self.pts = pts + def __repr__(self): + return repr({k: getattr(self, k) for k in self.__slots__}) + class EntityType(IntEnum): """ @@ -184,3 +190,6 @@ class Entity: return InputPeerChat(self.id) else: return InputPeerChannel(self.id, self.hash) + + def __repr__(self): + return repr({k: getattr(self, k) for k in self.__slots__})