[docs] [issue30550] Document order-preserving dictionary output in json
report at bugs.python.org
Sat Jul 13 17:57:40 EDT 2019
Kyle Stanley <aeros167 at 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.
Python tracker <report at bugs.python.org>
More information about the docs