Message288026
I agree with the confusion (PR proposes separators=COMPACT, issue compact=True).
I like the concept but not either of the APIs proposed. I *much* more often want to get pretty output -- if I had a dime for every time I've written "json.dumps(obj, sort_keys=True, indent=4)" I'd be rich enough to buy an entire cup of Starbucks coffee. But then you'd need a pretty=True option as well, which would be mutually exclusive with compact=True, so not great.
But what about a style= (or "format="?) parameter, which defaults to 'default' (or just None) meaning the same as now. If you pass format='pretty' you get "sort_keys=True, indent=4" and if you pass format='compact' you get "separators=(',', ':')". |
|
Date |
User |
Action |
Args |
2017-02-17 17:31:10 | benhoyt | set | recipients:
+ benhoyt, brett.cannon, rhettinger, bob.ippolito, vstinner, r.david.murray, berker.peksag, serhiy.storchaka, Alex Gordon, andrewnester |
2017-02-17 17:31:10 | benhoyt | set | messageid: <1487352670.49.0.851902507592.issue29540@psf.upfronthosting.co.za> |
2017-02-17 17:31:10 | benhoyt | link | issue29540 messages |
2017-02-17 17:31:10 | benhoyt | create | |
|