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 

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 <>
Python-bugs-list mailing list

Reply via email to