I would like to fork simplejson  and implement serialization rules based
on protocols instead of types , plus special cases for protocol free
objects, that breaks compatibility. The benefit will be a better API for
json serialization of custom classes and in the case of iterable it will
avoid a calls like:
The serialization of custom objects is documented in the class instead of
the ``default`` function of current simplejson implementation .
The encoding algorithm works with a priority list that is summarized in the
(ø) if the object implements a __json__ method, the returned value is used
as the serialization of the object
(*) special objects which are protocol free are serialized the same way it's
done currently in simplejson
(§) if the algorithm arrives here, call unicode (with proper encoding rule)
on the object and use the result as json serialization
As soon as an object match a rule, it's serialized.
What do you think ? Do you find this API an improvement over simplejson ? Is
it worth to code ?
Where are documented the different protocols implemented by Python objects ?