mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
#16333: document a way to get rid of trailing whitespace when indent is used.
This commit is contained in:
parent
0d68ab3f48
commit
3a237ebcaa
3 changed files with 26 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue