Skip to content

Instantly share code, notes, and snippets.

@HerrSpace
Created July 17, 2019 10:08
Show Gist options
  • Save HerrSpace/404b0b5588acbb670dc74cdc24f2b41d to your computer and use it in GitHub Desktop.
Save HerrSpace/404b0b5588acbb670dc74cdc24f2b41d to your computer and use it in GitHub Desktop.
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'}
@cyber-murmel
Copy link

Yeah, an exception would be appropriate when doing json.dumps(zz)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment