mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-22 15:17:00 +01:00
TelegramObject.to_dict(): use iterators
This commit is contained in:
parent
e9a782a3c8
commit
8ff8d57998
1 changed files with 2 additions and 1 deletions
|
@ -64,7 +64,8 @@ class TelegramObject(object):
|
||||||
"""
|
"""
|
||||||
data = dict()
|
data = dict()
|
||||||
|
|
||||||
for key, value in self.__dict__.items():
|
for key in iter(self.__dict__):
|
||||||
|
value = self.__dict__[key]
|
||||||
if value or value == '':
|
if value or value == '':
|
||||||
if hasattr(value, 'to_dict'):
|
if hasattr(value, 'to_dict'):
|
||||||
data[key] = value.to_dict()
|
data[key] = value.to_dict()
|
||||||
|
|
Loading…
Reference in a new issue