New submission from My-Tien Nguyen <my-tien.ngu...@ariadne.ai>:

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.

----------
components: +Library (Lib)
type:  -> behavior
versions: +Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34972>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to