Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #99733

Re: New JSON encoding method proposal for custom objects

From Marco Kaulea <marco.kaulea@gmail.com>
Newsgroups comp.lang.python
Subject Re: New JSON encoding method proposal for custom objects
Date 2015-11-30 09:42 +0100
Message-ID <mailman.32.1448873773.14615.python-list@python.org> (permalink)
References <aac1b6e8-e294-4916-9485-ffc031c3aeb3@googlegroups.com> <n3fnru$5sf$3@dont-email.me>

Show all headers | View raw


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@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

New JSON encoding method proposal for custom objects cescus92@gmail.com - 2015-11-29 07:05 -0800
  Re: New JSON encoding method proposal for custom objects Peter Otten <__peter__@web.de> - 2015-11-29 16:46 +0100
  Re: New JSON encoding method proposal for custom objects Denis McMahon <denismfmcmahon@gmail.com> - 2015-11-29 20:40 +0000
    Re: New JSON encoding method proposal for custom objects Marco Kaulea <marco.kaulea@gmail.com> - 2015-11-30 09:42 +0100
      Re: New JSON encoding method proposal for custom objects cescus92@gmail.com - 2015-11-30 04:35 -0800
        Re: New JSON encoding method proposal for custom objects Burak Arslan <burak.arslan@arskom.com.tr> - 2015-12-01 13:20 +0200
          Re: New JSON encoding method proposal for custom objects cescus92@gmail.com - 2015-12-01 04:08 -0800
        Re: New JSON encoding method proposal for custom objects Peter Otten <__peter__@web.de> - 2015-12-01 13:17 +0100
          Re: New JSON encoding method proposal for custom objects cescus92@gmail.com - 2015-12-01 04:24 -0800

csiph-web