mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Replace for loops with comprehensions
This commit is contained in:
@@ -81,13 +81,10 @@ class JsonDeserializable(object):
|
||||
raise ValueError("json_type should be a json dict or string.")
|
||||
|
||||
def __str__(self):
|
||||
d = {}
|
||||
for x, y in self.__dict__.items():
|
||||
if hasattr(y, '__dict__'):
|
||||
d[x] = y.__dict__
|
||||
else:
|
||||
d[x] = y
|
||||
|
||||
d = {
|
||||
x: y.__dict__ if hasattr(y, '__dict__') else y
|
||||
for x, y in self.__dict__.items()
|
||||
}
|
||||
return str(d)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user