mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Let's sort the keys so that this test passes even with random hashes.
This commit is contained in:
parent
b19fb2462e
commit
b69fa1f8b7
1 changed files with 1 additions and 1 deletions
|
@ -29,7 +29,7 @@ Encoding basic Python object hierarchies::
|
||||||
Compact encoding::
|
Compact encoding::
|
||||||
|
|
||||||
>>> import json
|
>>> import json
|
||||||
>>> json.dumps([1,2,3,{'4': 5, '6': 7}], separators=(',',':'))
|
>>> json.dumps([1,2,3,{'4': 5, '6': 7}], sort_keys=True, separators=(',',':'))
|
||||||
'[1,2,3,{"4":5,"6":7}]'
|
'[1,2,3,{"4":5,"6":7}]'
|
||||||
|
|
||||||
Pretty printing (using repr() because of extraneous whitespace in the output)::
|
Pretty printing (using repr() because of extraneous whitespace in the output)::
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue