STINNER Victor added the comment:
"Add compact=True flag to json.dump/dumps"
Oh, fun, I implemented exactly this option in my perf project. Extract:
def dump(data, fp, compact):
kw = {}
if compact:
kw['separators'] = (',', ':')
else:
kw['indent'] = 4
json.dump(data, fp, sort_keys=True, **kw)
So I like the idea of moving the compact=True feature directly into the json
module ;-)
(I don't propose to change the default to indent=4, that's a personal choice
;-))
----------
nosy: +haypo
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue29540>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com