diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2012-11-28 22:22:30 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2012-11-28 22:22:30 (GMT) |
commit | 3a237ebcaaf80ac293d4ef3e9b430b81fd7c236b (patch) | |
tree | 19b89d60f8615bcc9be9e93e1e0c4fc40cce3b82 /Lib/json/encoder.py | |
parent | 0d68ab3f481ab6c8ecb0d83762b4cd9fb9208356 (diff) | |
download | cpython-3a237ebcaaf80ac293d4ef3e9b430b81fd7c236b.zip cpython-3a237ebcaaf80ac293d4ef3e9b430b81fd7c236b.tar.gz cpython-3a237ebcaaf80ac293d4ef3e9b430b81fd7c236b.tar.bz2 |
#16333: document a way to get rid of trailing whitespace when indent is used.
Diffstat (limited to 'Lib/json/encoder.py')
-rw-r--r-- | Lib/json/encoder.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/json/encoder.py b/Lib/json/encoder.py index 169450d..4d1aaa8 100644 --- a/Lib/json/encoder.py +++ b/Lib/json/encoder.py @@ -131,7 +131,10 @@ class JSONEncoder(object): If indent is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. - None is the most compact representation. + None is the most compact representation. Since the default + item separator is ', ', the output might include trailing + whitespace when indent is specified. You can use + separators=(',', ': ') to avoid this. If specified, separators should be a (item_separator, key_separator) tuple. The default is (', ', ': '). To get the most compact JSON |