-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-146061: Fix contradicting sentences in json docs #146095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 7 commits
17a3337
a5c0e64
8cc270a
6729677
539d82c
5571e3c
62a65d9
307fbf1
64cfb01
9200894
f8f49dc
c8b2cd0
2336497
357302d
813cf20
ae431d1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,8 +142,8 @@ def dump(obj, fp, *, skipkeys=False, ensure_ascii=True, check_circular=True, | |
|
|
||
| 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. | ||
| level of 0 will only insert newlines. ``None`` gives a compact | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not true.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does give a compact representation. > python -c "print(__import__('json').dumps([{'a': 1, 'b': [2, 3], 'c': {'d': 4, 'e': [5, 6]}}, 7]))"
[{"a": 1, "b": [2, 3], "c": {"d": 4, "e": [5, 6]}}, 7]
> python -c "print(__import__('json').dumps([{'a': 1, 'b': [2, 3], 'c': {'d': 4, 'e': [5, 6]}}, 7], indent=None))"
[{"a": 1, "b": [2, 3], "c": {"d": 4, "e": [5, 6]}}, 7]
> python -c "print(__import__('json').dumps([{'a': 1, 'b': [2, 3], 'c': {'d': 4, 'e': [5, 6]}}, 7], indent=0))"
[
{
"a": 1,
"b": [
2,
3
],
"c": {
"d": 4,
"e": [
5,
6
]
}
},
7
]
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The term "compact" is ambiguous and misleading. It is not explicitly defined, and the only example for compact encoding uses What |
||
| representation; see below. | ||
|
|
||
| If specified, ``separators`` should be an ``(item_separator, | ||
| key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.