From 3f643242b1e3f039c161a6312137532226f102c0 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 17 Dec 2018 13:03:08 +0100 Subject: [PATCH] Reformat encoder style --- pyrogram/client/types/pyrogram_type.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pyrogram/client/types/pyrogram_type.py b/pyrogram/client/types/pyrogram_type.py index 18faa9e8..880c452a 100644 --- a/pyrogram/client/types/pyrogram_type.py +++ b/pyrogram/client/types/pyrogram_type.py @@ -44,8 +44,16 @@ def remove_none(obj): class Encoder(JSONEncoder): def default(self, o: PyrogramType): try: - content = {i: getattr(o, i) for i in filter(lambda x: not x.startswith("_"), o.__dict__)} + content = { + i: getattr(o, i) + for i in filter(lambda x: not x.startswith("_"), o.__dict__) + } except AttributeError: return repr(o) - return remove_none(OrderedDict([("_", "pyrogram:" + o.__class__.__name__)] + [i for i in content.items()])) + return remove_none( + OrderedDict( + [("_", "pyrogram:" + o.__class__.__name__)] + + [i for i in content.items()] + ) + )