From 07af386700a302da3d94f9b74513c241a15d9e73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 27 Jul 2025 00:00:25 +0200 Subject: [PATCH] [scripts/pyprint] support sets --- scripts/pyprint.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/pyprint.py b/scripts/pyprint.py index cdce2cc0..a946709b 100644 --- a/scripts/pyprint.py +++ b/scripts/pyprint.py @@ -86,8 +86,12 @@ def pyprint(obj, indent=0, lmax=16): if not obj: return "()" if len(obj) == 1: - return f'''({pyprint(obj[0], indent+4)},)''' - + return f'''({pyprint(obj[0])},)''' return f'''({", ".join(pyprint(v, indent+4) for v in obj)})''' + if isinstance(obj, set): + if not obj: + return "set()" + return f'''{{{", ".join(pyprint(v, indent+4) for v in obj)}}}''' + return f'''{obj}'''