Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #15010
| From | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| Subject | Re: Forking simplejson |
| Date | 2011-10-26 15:29 -0400 |
| References | <CAL7_Mo8cLHxh9bt1NvmJFDzLMz9K3gm9k53JRzRSKQPB1485BA@mail.gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2234.1319657367.27778.python-list@python.org> (permalink) |
On 10/26/2011 5:14 AM, Amirouche Boubekki wrote: > Héllo, > > I would like to fork simplejson [1] and implement serialization rules > based on protocols instead of types [2], 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: > > >>> simplejson.dumps(list(my_iterable)) > > The serialization of custom objects is documented in the class instead > of the ``default`` function of current simplejson implementation [3]. > > The encoding algorithm works with a priority list that is summarized in > the next table: > > +-------------------+---------------+ > | Python protocol | JSON | > | or special case | | > +===================+===============+ > | (ø) __json__ | see (ø) | > +-------------------+---------------| > | map | object | I am curious what you mean by the 'map' protocol. > Where are documented the different protocols implemented by Python objects ? Ref 3.3 special method names (and elsewhere ;-) http://docs.python.org/py3k/reference/datamodel.html#special-method-names --- Terry Jan Reedy
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Forking simplejson Terry Reedy <tjreedy@udel.edu> - 2011-10-26 15:29 -0400
csiph-web