Mercurial > cpython-lru_cache-weakref
diff Lib/json/encoder.py @ 80628:2a5b183ac3cd 3.2
#16333: document a way to get rid of trailing whitespace when indent is used.
| author | Ezio Melotti <ezio.melotti@gmail.com> |
|---|---|
| date | Thu, 29 Nov 2012 00:35:29 +0200 |
| parents | 06f21c6e0f2b |
| children | 5d56e1214e95 8b30a764b58d |
line wrap: on
line diff
--- a/Lib/json/encoder.py Wed Nov 28 19:23:52 2012 +0200 +++ b/Lib/json/encoder.py Thu Nov 29 00:35:29 2012 +0200 @@ -125,7 +125,10 @@ 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
