3 ms·
I thought pickle output was just JSON? Shows what I know.
by staticfish 13y ago
I thought pickle output was just JSON? Shows what I know.
- herge 13y agoIf it was JSON, how would you pickle dictionaries with tuples as keys?
- deleted 13y ago[deleted]
- habitue 13y agoThe 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.