mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-03 14:04:51 +00:00
Reformat encoder style
This commit is contained in:
parent
d31a696f32
commit
3f643242b1
1 changed files with 10 additions and 2 deletions
|
|
@ -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()]
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue