Created
July 17, 2019 10:08
-
-
Save HerrSpace/404b0b5588acbb670dc74cdc24f2b41d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [7]: zz={1:2, '1':'2'} | |
In [8]: zz | |
Out[8]: {1: 2, '1': '2'} | |
In [9]: json.dumps(zz) | |
Out[9]: '{"1": 2, "1": "2"}' | |
In [11]: qq=json.loads(json.dumps(zz)) | |
In [12]: qq | |
Out[12]: {'1': '2'} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah, an exception would be appropriate when doing
json.dumps(zz)