Island: Check for a set representation and return a list

This commit is contained in:
Ilija Lazoroski 2022-07-27 15:12:52 +02:00
parent a1896de9c8
commit bb3bf5ebd4
1 changed files with 2 additions and 0 deletions

View File

@ -22,6 +22,8 @@ class APIEncoder(JSONEncoder):
return value.name return value.name
if issubclass(type(value), IJSONSerializable): if issubclass(type(value), IJSONSerializable):
return loads(value.__class__.to_json(value)) return loads(value.__class__.to_json(value))
if issubclass(type(value), set):
return list(value)
try: try:
return JSONEncoder.default(self, value) return JSONEncoder.default(self, value)
except TypeError: except TypeError: