You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if a string is passed to indent, the indent char is the first char of the string and the indent char count is the length of the indent string. e.g. indent="\t\t" would be 2 tabs (but so would indent="\tA".
decide whether to keep this. might be nice if someone wanted to use tabs instead of spaces.
if kept, need to raise an exception if the string is not ascii.
I think staying compatible with the python stdlib would be nice here, so only supporting integers indent=4. The stdlib uses the separators kwargs to allow people to add tabs if they want
If indent is a non-negative integer or string, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0, negative, or "" will only insert newlines. None (the default) selects the most compact representation. Using a positive integer indent indents that many spaces per level. If indent is a string (such as "\t"), that string is used to indent each level.
Changed in version 3.2: Allow strings for indent in addition to integers.
Activity
sontek commentedon Sep 17, 2015
I think staying compatible with the python stdlib would be nice here, so only supporting integers
indent=4. The stdlib uses theseparatorskwargs to allow people to add tabs if they wantkenrobbins commentedon Sep 17, 2015
The stdlib supports strings now:
https://docs.python.org/3/library/json.html
It will be easier and less weird if we only support ints though.
Declare indentCharCount as an unsigned integer