> First of all, for sequences (JSON arrays; Python lists), the order is
> preserved. For hashes (JSON objects), by default Python dicts are
> used, which does not preserve the order. As with the Python json or
> simplejson decoders (which also use dicts by default and thus also do
> not preserve order), you can specify a function that receives the
> ordered pairs of key/values (or if you wish to use the enhanced syntax
> which allows nested keys, you can specify a function that receives
> tuples of (key, [key, ...] value])).
> So, by default, the order of key/value pairs in objects is not
> behavior if you wish to do so.
> Best regards,
for that matter). Only with regards to serialization and de-serialization
(and obviously for Array's). When you need it for some purpose on objects
the trick is usually therefore to make an array and keep the
ordinality/indexing info there for each desired ordered object property.
However, you might just comment on this fact in your RSON manual (however
clear and apparent it may be for some devs) ;-)
Many are confused about this specific topic - and I catch it out of the
corner of my eye nearly every time I come across it, because I have made a
great deal of JSON to XML and back again - and in XML documents, ordinality
matters (XPATH can use element indexes).