I cant recall if json files have the same limitation; you could save the file as .json or plain text, using a json dict format. Then use json.load to read it into a dict. obviously only works for json compatible types.