➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author My-Tien Nguyen
Recipients My-Tien Nguyen
Date 2018-10-13.10:24:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1539426263.62.0.788709270274.issue34972@psf.upfronthosting.co.za>
In-reply-to
Content
When int keys are silently converted to string on json serialization, the user needs to remember to convert it back to int on loading.
I think that a warning should be shown at least.

In my case I serialize a dict to json with int keys, later load it back into a dict (resulting in a dict with string keys) and test for existence of an int key in the dict which will then return False incorrectly.

I am aware that json does not support int keys, but this can be easily forgotten.
History
Date User Action Args
2018-10-13 10:24:23My-Tien Nguyensetrecipients: + My-Tien Nguyen
2018-10-13 10:24:23My-Tien Nguyensetmessageid: <1539426263.62.0.788709270274.issue34972@psf.upfronthosting.co.za>
2018-10-13 10:24:23My-Tien Nguyenlinkissue34972 messages
2018-10-13 10:24:23My-Tien Nguyencreate