Ben Hoyt added the comment:

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=(',', ':')".

----------
nosy: +benhoyt

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29540>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to