Alex Gordon added the comment:
The point is that, as a principle of good API design, the json module should
not generate malformed JSON unless the user very explicitly asks for their JSON
to be corrupted.
Python stands alone in having a JSON serializer that can produce strings such
as {&q
New submission from Alex Gordon:
Broadly speaking, there are three main output styles for json.dump/dumps:
1. Default: json.dumps(obj)
2. Compact: json.dumps(obj, separators=(',', ':'))
3. Pretty-printing: json.dumps(obj, sort_keys=True, indent=4)
The 'compact'