You bring up some good points.
From the POV of "give me something that works"
it's probably in our best interest to make these
things the default.
Nested object hierarchies necessitate sorted keys so that
decode() has a chance to reconstruct the object hieararchy
correctly. I think it would be good idea if the
global backend-specific options comes pre-seeded with
sort_keys=True.
We have already made decode() assume sorted keys
(and that's the only way we can really do it)
$ git show 8a0a07a713ed11a924d6e34cdb6b2fc9b6238ec4
commit 8a0a07a713ed11a924d6e34cdb6b2fc9b6238ec4
Author: David K. Hess <nos...@nospam.com>
Date: Tue Feb 9 16:05:49 2010 -0600
If an interpreter of a jsonpickle stream has a different dictionary key
hashing algorithm from the one that produced it, then the problem of a
py/ref before a py/object can occur. If the hashing algorithms are exactly
the same (i.e. dict.keys() produces the same ordering of keys in both the
encoder and decoder domains), then the problem will not occur.
This case occurs when using (for example) Objective-C and NSDictionary
to interpret a jsonpickle stream.
The patch sorts dictionary keys when both encoding and decoding so that
the process is independent of the dict key hashing algorithm.
--
David