New submission from Korabelnikov Aleksandr <[email protected]>:
when i serialize and deserialize python built-in structure I'm expect output
same as input
arr2 = [1,2,'3']
arr2_json = json.dumps(arr2)
json.loads(arr2_json)
Out[16]: [1, 2, '3']
BUT when I'm tring do it with dict I got str keys instead of integer
dict1 = {0: 'object0', '1': 'object2'}
json1 = json.dumps(dict1)
json.loads(json1)
Out[6]: {'0': 'object0', '1': 'object2'}
Notice keys must be [0, '1'] but actually are ['0', '1']
----------
components: Library (Lib)
messages: 311951
nosy: solin
priority: normal
severity: normal
status: open
title: Python's json dumps/loads make integer keys of the dict str
type: behavior
versions: Python 3.5
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue32816>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com