New JSON encoding method proposal for custom objects
Marco Kaulea
marco.kaulea at gmail.com
Mon Nov 30 03:42:01 EST 2015
Hi,
I think his goal is not to load the data back into python, but to use
it to provide some
kind of REST-Style interface. An example would be, if you have a class
instance of
a record of a movie, that it could be simply encoded and send over the
wire to display.
Without necessarily recreating the class on the other end.
This would prevent any security risks from the deserialization.
On Sun, Nov 29, 2015 at 9:40 PM, Denis McMahon <denismfmcmahon at gmail.com> wrote:
> That's all well and good, but firstly you need to both dumps and loads to
> work properly with json, and secondly there's no mechanism in json that
> tells you what class of object you have.
But I am not sure how useful that PEP/Change would be, assuming the
code in Peter's response
works.
- Marco Kaulea
More information about the Python-list
mailing list