Re:Don't Pickle Your Data
by staticfish on Wednesday February 12, 2014 @02:49PM
(#7226817)
I thought pickle output was just JSON? Shows what I know.
[ Parent
| on HN ]
If it was JSON, how would you pickle dictionaries with tuples as keys?
The same way you would in JavaScript: turn it into a string first. "(1, 2)" Its not that serializing python objects to json is impossible, just that there is not a straightforward implementation that everyone agrees is correct.
For a fully general python <-> json serializer/deserializer, you'd need a bunch of extra annotations etc that would make it look very weird compared with what most people expect when they think of json.