From 9e88d9d219e9254c239fe50240b42af8ad8c6670 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sat, 5 Aug 2017 09:36:07 +0200 Subject: [PATCH] Replace "type is Type" check with "isinstance" --- telethon_examples/interactive_telegram_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telethon_examples/interactive_telegram_client.py b/telethon_examples/interactive_telegram_client.py index ee2c67c4..a6346aaa 100644 --- a/telethon_examples/interactive_telegram_client.py +++ b/telethon_examples/interactive_telegram_client.py @@ -275,7 +275,7 @@ class InteractiveTelegramClient(TelegramClient): @staticmethod def update_handler(update_object): - if type(update_object) is UpdateShortMessage: + if isinstance(update_object, UpdateShortMessage): if update_object.out: sprint('You sent {} to user #{}'.format( update_object.message, update_object.user_id)) @@ -283,7 +283,7 @@ class InteractiveTelegramClient(TelegramClient): sprint('[User #{} sent {}]'.format( update_object.user_id, update_object.message)) - elif type(update_object) is UpdateShortChatMessage: + elif isinstance(update_object, UpdateShortChatMessage): if update_object.out: sprint('You sent {} to chat #{}'.format( update_object.message, update_object.chat_id))