You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python's json dumps/loads make integer keys of the dict str #76997
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2018-02-10.16:45:44.768>created_at=<Date2018-02-10.15:59:52.269>labels= ['invalid', 'type-bug', 'library']
title="Python's json dumps/loads make integer keys of the dict str"updated_at=<Date2018-02-10.16:45:44.766>user='https://bugs.python.org/solin'
See the documentation. This is documented behavior. The JSON format supports only string keys, and all keys are coerced to strings when serialized to JSON.
Activity
solin commentedon Feb 10, 2018
when i serialize and deserialize python built-in structure I'm expect output same as input
BUT when I'm tring do it with dict I got str keys instead of integer
Notice keys must be [0, '1'] but actually are ['0', '1']
serhiy-storchaka commentedon Feb 10, 2018
See the documentation. This is documented behavior. The JSON format supports only string keys, and all keys are coerced to strings when serialized to JSON.