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


Groups > comp.lang.python > #77592

Re: Storing instances using jsonpickle

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python@mrabarnett.plus.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'encoding': 0.05; 'mrab': 0.05; 'say,': 0.05; '(so': 0.07; 'json': 0.07; 'delimited': 0.09; 'occasionally': 0.09; 'subject:using': 0.09; 'subset': 0.09; 'subtle': 0.09; 'trailing': 0.09; 'python': 0.11; '(0,': 0.16; ':-(': 0.16; 'ah,': 0.16; 'called,': 0.16; 'comma': 0.16; 'comma,': 0.16; 'comma.': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'interpreter,': 0.16; 'it),': 0.16; 'json,': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'one-element': 0.16; 'plop': 0.16; 'received:192.168.1.4': 0.16; 'repl': 0.16; 'syntax,': 0.16; 'tuple': 0.16; 'tuple,': 0.16; 'tuples,': 0.16; 'typos': 0.16; '(0)': 0.16; 'prevent': 0.16; 'wrote:': 0.18; '(not': 0.18; "python's": 0.19; 'thu,': 0.19; 'seems': 0.21; 'header:User- Agent:1': 0.23; '(or': 0.24; 'define': 0.26; 'equivalent': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'start,': 0.30; 'strongly': 0.30; "i'm": 0.30; 'that.': 0.31; 'convenience': 0.31; 'correctly.': 0.31; 'sep': 0.31; 'tuples': 0.31; 'compatible': 0.32; "i'd": 0.34; 'something': 0.35; 'add': 0.35; 'there': 0.35; 'whatever': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'even': 0.60; 'problems.': 0.60; 'making': 0.63; 'name': 0.63; 'therefore,': 0.64; 'worth': 0.66; 'between': 0.67; 'default': 0.69; "'true'": 0.84; "it'd": 0.84
X-CM-Score 0.00
X-CNFS-Analysis v=2.1 cv=Uv7tNoAB c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=u9EReRu7m0cA:10 a=8GIvbBF9nK0A:10 a=MQH2_SA4b-8A:10 a=ihvODaAuJD4A:10 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=eVlmhOZtOIYchzjXLm8A:9 a=QEXdDO2ut3YA:10
X-AUTH mrabarnett:2500
Date Fri, 05 Sep 2014 18:04:11 +0100
From MRAB <python@mrabarnett.plus.com>
User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version 1.0
To python-list@python.org
Subject Re: Storing instances using jsonpickle
References <c54f7a2f-cf2c-4ee9-ba8e-a309761c1c6a@googlegroups.com> <mailman.13748.1409777587.18130.python-list@python.org> <46e782a5-b087-4f95-aadb-26e233bf5419@googlegroups.com> <5407A69B.3030707@mrabarnett.plus.com> <CAPTjJmob5Qntc_E_nXMBQB-wyccNy4_LuPo0bNKBSh2FsUv0=w@mail.gmail.com>
In-Reply-To <CAPTjJmob5Qntc_E_nXMBQB-wyccNy4_LuPo0bNKBSh2FsUv0=w@mail.gmail.com>
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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>
Newsgroups comp.lang.python
Message-ID <mailman.13793.1409936654.18130.python-list@python.org> (permalink)
Lines 38
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1409936654 news.xs4all.nl 2920 [2001:888:2000:d::a6]:32998
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:77592

Show key headers only | View raw


On 2014-09-04 06:17, Chris Angelico wrote:
> On Thu, Sep 4, 2014 at 9:39 AM, MRAB <python@mrabarnett.plus.com> wrote:
>> I occasionally think about a superset of JSON, called, say, "pyson" ...
>> ah, name already taken! :-(
>
> While I'm somewhat sympathetic to the concept, there are some parts of
> your description that I disagree with. Am I misreading something? Are
> there typos in the description and I'm making something out of
> nothing?
>
>> It would add tuples, delimited by (...), which are not used otherwise (no
>> expressions):
>>
>>     () => ()
>>     (0, ) => (0)
>
> This seems odd. Part of JSON's convenience is that it's a subset of
> JavaScript syntax, so you can just plop a block of JSON into a REPL
> and it'll decode correctly. With PyON (or whatever you call it), it'd
> be nice to have the same correspondence; for a start, I would strongly
> encourage the "trailing comma is permitted" rule (so [1,2,3,] is
> equivalent to [1,2,3]), and then I'd have the default encoding for a
> single-element tuple include that trailing comma. If (0) is a
> one-element tuple, you end up with a subtle difference between a PyON
> decode and the Python interpreter, which is likely to cause problems.
> It might even be worth actually mandating (not just encouraging) that
> one-element tuples have the trailing comma, just to prevent that.
>
[snip]

JSON has 'true' and 'false'.

Python has 'True' and 'False'.

Therefore, if you want it to be able to drop it into Python's REPL, it
won't be compatible with JSON anyway! (Well, not unless you define
'true' and 'false' first.)

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


Thread

Storing instances using jsonpickle Josh English <Joshua.R.English@gmail.com> - 2014-09-03 13:32 -0700
  Re: Storing instances using jsonpickle Ned Batchelder <ned@nedbatchelder.com> - 2014-09-03 16:52 -0400
    Re: Storing instances using jsonpickle Josh English <Joshua.R.English@gmail.com> - 2014-09-03 15:30 -0700
      Re: Storing instances using jsonpickle MRAB <python@mrabarnett.plus.com> - 2014-09-04 00:39 +0100
        Re: Storing instances using jsonpickle Denis McMahon <denismfmcmahon@gmail.com> - 2014-09-04 01:11 +0000
      Re: Storing instances using jsonpickle Ned Batchelder <ned@nedbatchelder.com> - 2014-09-03 22:18 -0400
        Re: Storing instances using jsonpickle Sam Raker <sam.raker@gmail.com> - 2014-09-03 21:52 -0700
        Re: Storing instances using jsonpickle Josh English <Joshua.R.English@gmail.com> - 2014-09-15 12:30 -0700
      Re: Storing instances using jsonpickle Chris Angelico <rosuav@gmail.com> - 2014-09-04 15:17 +1000
        Re: Storing instances using jsonpickle Dan Sommers <dan@tombstonezero.net> - 2014-09-05 04:38 +0000
          Re: Storing instances using jsonpickle Chris Angelico <rosuav@gmail.com> - 2014-09-05 15:08 +1000
      Re: Storing instances using jsonpickle MRAB <python@mrabarnett.plus.com> - 2014-09-04 12:07 +0100
      Re: Storing instances using jsonpickle MRAB <python@mrabarnett.plus.com> - 2014-09-05 18:04 +0100
        Re: Storing instances using jsonpickle Marko Rauhamaa <marko@pacujo.net> - 2014-09-05 20:16 +0300
          Re: Storing instances using jsonpickle Ned Batchelder <ned@nedbatchelder.com> - 2014-09-05 13:30 -0400
            Re: Storing instances using jsonpickle Marko Rauhamaa <marko@pacujo.net> - 2014-09-05 21:04 +0300
              Re: Storing instances using jsonpickle Ned Batchelder <ned@nedbatchelder.com> - 2014-09-05 16:50 -0400
                Re: Storing instances using jsonpickle Marko Rauhamaa <marko@pacujo.net> - 2014-09-05 23:57 +0300
          Re: Storing instances using jsonpickle Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2014-09-06 00:18 +0200
      Re: Storing instances using jsonpickle Chris Angelico <rosuav@gmail.com> - 2014-09-06 10:20 +1000
      Re: Storing instances using jsonpickle MRAB <python@mrabarnett.plus.com> - 2014-09-06 17:32 +0100
      Re: Storing instances using jsonpickle Ned Batchelder <ned@nedbatchelder.com> - 2014-09-06 12:56 -0400
      Re: Storing instances using jsonpickle Terry Reedy <tjreedy@udel.edu> - 2014-09-06 14:27 -0400

csiph-web