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

Path csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From Marco Kaulea <marco.kaulea@gmail.com>
Newsgroups comp.lang.python
Subject Re: New JSON encoding method proposal for custom objects
Date Mon, 30 Nov 2015 09:42:01 +0100
Lines 21
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>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de pLPEqlDuQDr35gaAbOWsXwQadlVEqgeHLdeqOSDjU65A==
Return-Path <marco.kaulea@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.010
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'python,': 0.02; 'encoded': 0.05; 'json': 0.05; 'works.': 0.07; 'subject:method': 0.09; 'properly': 0.15; 'json,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:JSON': 0.16; 'wrote:': 0.16; 'mechanism': 0.18; 'tells': 0.18; 'load': 0.20; '2015': 0.20; 'prevent': 0.20; 'assuming': 0.22; 'header:In-Reply-To:1': 0.24; 'example': 0.26; 'message-id:@mail.gmail.com': 0.27; 'record': 0.29; 'dumps': 0.29; 'loads': 0.29; 'secondly': 0.29; 'code': 0.30; 'useful': 0.33; 'class': 0.33; 'received:google.com': 0.35; 'could': 0.35; 'instance': 0.35; 'nov': 0.35; 'but': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'received:209.85.220': 0.38; 'hi,': 0.38; 'data': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'provide': 0.61; 'back': 0.62; 'necessarily': 0.63; 'goal': 0.64; 'denis': 0.84; 'movie,': 0.84; 'good,': 0.93; 'have.': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=PQX3rOEs3icMbUcOBAo5jO6QE4fLEyXt8e/3NHlkhCY=; b=slOztQApfBUXFYq/Vhahj0wM4TbEJck2mCIVbYArVJqcAaRTVJy4EZwMRYR1DC8ayo jaolKTt7YTMk91FHI6ZQrl1BAByx/3NdW866l67FZahcZrEsBAaXvCRyAsZfE4aIn0VX gNvmE/UuE4XJOd/2DgKYpRJi/LuGBBwh/BgBMrTsu+JBu5LFTcuHAAOvwmuQWxAb01Gf yxDYL53ZBaM2yDWjzT/4YeJc1RqnF15Gp5SgMDAElMcsuSOOZ0mKNDQ1lL+O39NVkUTM lfKobK7Q2UCev7EdK/BbcFryHer9B+xqWDqLVnPGl6ZkzU/GSF4IRIxCZJNNyqY4xrNN 4JrQ==
X-Received by 10.55.76.213 with SMTP id z204mr70642142qka.58.1448872941099; Mon, 30 Nov 2015 00:42:21 -0800 (PST)
In-Reply-To <n3fnru$5sf$3@dont-email.me>
X-Mailman-Approved-At Mon, 30 Nov 2015 03:56:11 -0500
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:99733

Show key headers only | 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