anatoly techtonik added the comment:
Nice conflict case for explaining why perfect API is not here.
Because ', ' is now used as an item separator inline and separator for items
that span multiple lines, we get trailing whitespace. If ',' is used, items
will collide. To resolve this conflict democratically, a new option should be
added, but..
If it is a JSON module then what separator are we talking about in the first
place? It is not CSV, other separators are not in specification, so why is it
there?
The only reason is to get the most compact representation. I doubt anybody uses
any value except (',', ':'), so the `compact=True` should be sufficient.
As for this patch - there should be no doubt that it should be applied to all
branches. The logic works only when indent is in force and that already breaks
custom separators by inserting indents and newlines. Other argument that nobody
will do JSON parsing with whitespace analysis, and even if they do - they'll
still need to implement workaround for newlines.
----------
nosy: +techtonik
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue16333>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com