I used to use pickle for all my object serialization needs. Besides the obvious disadvantage that the files created are not human readable I encountered other issues. Pickled files created with python 2 and 3 used different protocols (I believe 3 could read pickled files made with python 2 but the reverse wasn't true). People also constantly talk about how unpickling something is almost as bad as using eval or exec if the source is unknown.
I decided this project to try some alternatives and I'm constantly seeing people talk about json so I gave that a try. I quickly realized, and confirmed, that you can't use nonstring keys when serializing an object in json. This was a pretty big deal breaker as the data I'm trying to serialize are map coordinates. Keys are all tuples.
I ended up going with YAML for the moment and it seems to work pretty well (according to documentation all the same security risks associated with pickle remain).
I am however left wondering why json is seen as useful in python at all. Keys are all coerced to strings when possible (and flat out fail if not); certain objects like tuples can be used as the value for a key, but on converting to json will become lists; certain other objects are simply unserializable, like sets.
So... why json?