Dumping and loading a dict with None as key, results in a dictionary with 'null' as the key.
Values are un-affected, but things get even worse if a string-key 'null' actually exists.
What am I doing wrong here? Why can’t I serialize/deserialize a dict with None keys?
Example
>>> json.loads(json.dumps({'123':None, None:'What happened to None?'}))
{u'123': None, u'null': u'What happened to None?'}
>>> json.loads(json.dumps({'123':None, None:'What happened to None?', 'null': 'boom'}))
{u'123': None, u'null': u'boom'}
JSON objects are maps of strings to values. If you try to use another type of key, they’ll get converted to strings.