Skip to content

Commit

Permalink
fix: formats serialization with black (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
psykzz authored Dec 31, 2023
1 parent 31fbecc commit 0ad3690
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rustplus/api/structures/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@


class Serializable:

def serialize(self):
data = {}
for k, v in self.__dict__.items():
key = k if k[0] != "_" else k[1:]
if isinstance(v, Serializable):
data[key] = v.serialize()
elif isinstance(v, Sequence) and all(isinstance(element, Serializable) for element in v):
elif isinstance(v, Sequence) and all(
isinstance(element, Serializable) for element in v
):
data[key] = [e.serialize() for e in v]
else:
data[key] = str(v)

return data

0 comments on commit 0ad3690

Please sign in to comment.