From 8ff8d579981861b1e0804893d85c2666871a61ce Mon Sep 17 00:00:00 2001 From: Noam Meltzer Date: Mon, 25 Apr 2016 13:15:54 +0300 Subject: [PATCH] TelegramObject.to_dict(): use iterators --- telegram/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/telegram/base.py b/telegram/base.py index f86f1433a..db7c231a7 100644 --- a/telegram/base.py +++ b/telegram/base.py @@ -64,7 +64,8 @@ class TelegramObject(object): """ data = dict() - for key, value in self.__dict__.items(): + for key in iter(self.__dict__): + value = self.__dict__[key] if value or value == '': if hasattr(value, 'to_dict'): data[key] = value.to_dict()