From 985e50fd2ccb8ecb5d20fb2da0edace32c3a6e55 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Thu, 3 Feb 2022 15:24:05 +0100 Subject: [PATCH] added support for sets (as sorted list) to the JSONEncoder --- slic/utils/jsonext.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/slic/utils/jsonext.py b/slic/utils/jsonext.py index 77f26e0ff..af6613e06 100644 --- a/slic/utils/jsonext.py +++ b/slic/utils/jsonext.py @@ -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)