I have a dictionary with frozenset-typed (variable-length, non-duplicate data) keys and I need to write this dictionary into a JSON file.
However, my problem is that frozenset (although immutable) is not a Python simple data type and I get this type error in result of json.dump(myDict, myFile)
:
TypeError: key frozenset({'myKey'}) is not a string
Could anyone please help me with some hints or solutions? I'm using Python 3.4.
I know I can manually serialize the object, but aren't there any other more automatic ways?!