added support for sets (as sorted list) to the JSONEncoder

This commit is contained in:
2022-02-03 15:24:05 +01:00
parent dcbc17b2fa
commit 985e50fd2c
+2
View File
@@ -14,6 +14,8 @@ class ExtendedJSONEncoder(json.JSONEncoder):
return {"real": obj.real, "imag": obj.imag}
elif isinstance(obj, Path):
return str(obj)
elif isinstance(obj, set):
return sorted(obj)
return super().default(obj)