[issue30550] Document order-preserving dictionary output in json

July 13, 2019
9:57 p.m.
Kyle Stanley <aeros167@gmail.com> added the comment:
The JSON encoder for dictionaries preserves the order of the items in a dictionary
From what I can tell, the JSON encoder does nothing to preserve the order of the keys. Although the default option is to not modify the existing dictionary, the items() method returns the k,v pairs in a non-random arbitrary manner, which may not match the order the values were entered in. See https://docs.python.org/2/library/stdtypes.html#dict.items.
---------- nosy: +aeros167 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue30550> _______________________________________
2054
Age (days ago)
2054
Last active (days ago)
0 comments
1 participants
participants (1)
-
Kyle Stanley