[scripts/pyprint] support sets
This commit is contained in:
@@ -86,8 +86,12 @@ def pyprint(obj, indent=0, lmax=16):
|
|||||||
if not obj:
|
if not obj:
|
||||||
return "()"
|
return "()"
|
||||||
if len(obj) == 1:
|
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)})'''
|
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}'''
|
return f'''{obj}'''
|
||||||
|
|||||||
Reference in New Issue
Block a user