Message287774
"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 ;-)) |
|
Date |
User |
Action |
Args |
2017-02-14 13:32:45 | vstinner | set | recipients:
+ vstinner, brett.cannon, rhettinger, bob.ippolito, r.david.murray, berker.peksag, serhiy.storchaka, Alex Gordon, andrewnester |
2017-02-14 13:32:45 | vstinner | set | messageid: <1487079165.0.0.219611801051.issue29540@psf.upfronthosting.co.za> |
2017-02-14 13:32:44 | vstinner | link | issue29540 messages |
2017-02-14 13:32:44 | vstinner | create | |
|