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


Groups > comp.lang.python > #92382

Re: enhancement request: make py3 read/write py2 pickle format

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.de!ecngs!feeder.ecngs.de!border1.nntp.ams1.giganews.com!nntp.giganews.com!bcyclone01.am1.xlned.com!bcyclone01.am1.xlned.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.014
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'schema': 0.05; 'json': 0.07; 'nicely': 0.07; 'plenty': 0.07; 'cc:addr:python-list': 0.10; 'wed,': 0.15; 'as-is': 0.16; 'evaluates': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'missing,': 0.16; 'subject:make': 0.16; 'trap.': 0.16; 'valid.': 0.16; 'value.)': 0.16; 'wrote:': 0.16; '(not': 0.20; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; 'correctly.': 0.22; 'libraries': 0.22; 'parse': 0.22; 'parsing': 0.22; 'subject:request': 0.22; 'am,': 0.23; '2015': 0.23; 'passing': 0.23; 'header:In-Reply- To:1': 0.24; 'points': 0.27; 'plain': 0.27; 'room': 0.27; 'message-id:@mail.gmail.com': 0.28; "doesn't": 0.28; 'subject:/': 0.29; 'cases.': 0.29; 'dictionary': 0.29; 'strings,': 0.29; 'sure,': 0.29; 'values': 0.30; 'becomes': 0.31; 'usually': 0.33; 'true.': 0.33; 'received:google.com': 0.34; 'gives': 0.35; 'returning': 0.35; 'but': 0.36; 'except': 0.36; 'there': 0.36; '(and': 0.36; 'cases': 0.36; 'smaller': 0.36; 'subject:: ': 0.37; 'stuff': 0.38; 'mean': 0.38; 'easily': 0.39; 'data': 0.40; 'where': 0.40; 'some': 0.40; 'field': 0.60; 'simple': 0.61; 'default': 0.61; 'biggest': 0.67; 'benefit': 0.70; 'sounds': 0.72; 'lack': 0.76; 'chrisa': 0.84; 'dict,': 0.84; 'restricted.': 0.84; 'subject:read': 0.84; 'subject:write': 0.84; 'to:none': 0.90; 'favour': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=UMaKdLYUl7hMctED3s8AUCXdc6mrS0+x9Mj/LM6lavM=; b=vwCZV4V0T7QswdkLd5da1sDwrgoJDK2MovlxJ+YzcPgleZUadX2cPPQxyRwB8XuK1M rmsxZXwT29fXR+STR5V3rYdBeRLa1c5dMTgo7mQHGKk3iAZnWxG3KwqXFM9Lb0CiGUUc bnhJDiiVwK3WS71Hgyptr/FNqKSCgQq7Pq996rvZFkqUey0mgh7auoJxzJLD5PTI8Vtx ux3F46Xy9QKBA3qra9YnoEB0qokKXEveHdRoeVn+KoiGYkjpYD70F619goQBIQK+gJUC 4nsO/Q/VQPuF8usZb1TzJ8lfOeMvCna29WQj3ZKDx/aUf1Jm6XP4BV5FGVEFDQsyFN0k 4XOw==
MIME-Version 1.0
X-Received by 10.43.0.67 with SMTP id nl3mr1812622icb.59.1433898229321; Tue, 09 Jun 2015 18:03:49 -0700 (PDT)
In-Reply-To <CABicbJJ_ZxExukTcmFaE_ar1bYgW3xb5tOkG3BNdr5XcSKGQpg@mail.gmail.com>
References <ml7a2p$hp$1@ger.gmane.org> <CAMw+j7K7JmRPo3PnzTE2rZEstdZRF085+VA=v1ieMMHk2Gp6mQ@mail.gmail.com> <CABicbJ+e02OKYi48kbjFFutyLUGgkEQdiPZqiB657AO+QKu11Q@mail.gmail.com> <mailman.325.1433891190.13271.python-list@python.org> <55778208$0$2899$e4fe514c@news2.news.xs4all.nl> <CABicbJJ_ZxExukTcmFaE_ar1bYgW3xb5tOkG3BNdr5XcSKGQpg@mail.gmail.com>
Date Wed, 10 Jun 2015 11:03:49 +1000
Subject Re: enhancement request: make py3 read/write py2 pickle format
From Chris Angelico <rosuav@gmail.com>
Cc "comp.lang.python" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
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>
Newsgroups comp.lang.python
Message-ID <mailman.329.1433898232.13271.python-list@python.org> (permalink)
Lines 28
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1433898232 news.xs4all.nl 2957 [2001:888:2000:d::a6]:55648
X-Complaints-To abuse@xs4all.nl
X-Received-Bytes 5308
X-Received-Body-CRC 2164265799
Xref csiph.com comp.lang.python:92382

Show key headers only | View raw


On Wed, Jun 10, 2015 at 10:47 AM, Devin Jeanpierre
<jeanpierreda@gmail.com> wrote:
> Passing around data that can be put into ast.literal_eval is
> synonymous with passing around data taht can be put into eval. It
> sounds like a trap.

Except that it's hugely restricted. There are JSON parsing libraries
all over the place, and one of the points in favour of JSON is that it
can be dumped into JavaScript as-is and it evaluates correctly.
Doesn't mean you have to use eval() to parse it, and usually you
won't.

> Other points against JSON / etc.: the lack of schema makes it easier
> to stuff anything in there (not as easily as pickle, mind), and by
> returning a plain dict, it becomes easier to require a field than to
> allow a field to be missing, which is bad for robustness and bad for
> data format migrations. (Protobuf (v3) has schemas and gives every
> field a default value.)

This is true. But there are plenty of cases where you can manage on a
simple dictionary that maps keywords to values that are either
strings, numbers, or lists/dicts of same - and without any schema to
tell you what keywords are valid. It's simple, extensible, and scales
reasonably well to mid-sized use cases. Sure, the biggest cases (and
some of the smaller ones) benefit nicely from schema definitions, but
there's room to manage without.

ChrisA

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


Thread

Re: enhancement request: make py3 read/write py2 pickle format Chris Angelico <rosuav@gmail.com> - 2015-06-10 09:06 +1000
  Re: enhancement request: make py3 read/write py2 pickle format Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2015-06-10 02:17 +0200
    Re: enhancement request: make py3 read/write py2 pickle format Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-06-09 17:47 -0700
      Re: enhancement request: make py3 read/write py2 pickle format Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-06-10 13:52 +1000
        Re: enhancement request: make py3 read/write py2 pickle format random832@fastmail.us - 2015-06-09 23:57 -0400
          Re: enhancement request: make py3 read/write py2 pickle format Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-06-10 15:43 +1000
        Re: enhancement request: make py3 read/write py2 pickle format Chris Angelico <rosuav@gmail.com> - 2015-06-10 14:00 +1000
        Re: enhancement request: make py3 read/write py2 pickle format Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-06-09 21:48 -0700
          Re: enhancement request: make py3 read/write py2 pickle format Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-06-10 19:36 +1000
            Re: enhancement request: make py3 read/write py2 pickle format Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2015-06-10 19:34 +0200
            Re: enhancement request: make py3 read/write py2 pickle format Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-06-10 15:10 -0700
              Re: enhancement request: make py3 read/write py2 pickle format Steven D'Aprano <steve@pearwood.info> - 2015-06-11 13:21 +1000
                Re: enhancement request: make py3 read/write py2 pickle format Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-06-10 22:39 -0700
                Re: enhancement request: make py3 read/write py2 pickle format Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-06-11 19:20 +1000
            Re: enhancement request: make py3 read/write py2 pickle format Terry Reedy <tjreedy@udel.edu> - 2015-06-10 19:25 -0400
            Re: enhancement request: make py3 read/write py2 pickle format Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-06-10 16:39 -0700
            Re: enhancement request: make py3 read/write py2 pickle format Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-06-10 16:48 -0700
            Re: enhancement request: make py3 read/write py2 pickle format Terry Reedy <tjreedy@udel.edu> - 2015-06-10 19:46 -0400
            Re: enhancement request: make py3 read/write py2 pickle format Chris Angelico <rosuav@gmail.com> - 2015-06-11 09:58 +1000
            Re: enhancement request: make py3 read/write py2 pickle format Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-06-10 17:02 -0700
              Re: enhancement request: make py3 read/write py2 pickle format Marko Rauhamaa <marko@pacujo.net> - 2015-06-11 07:08 +0300
            Re: enhancement request: make py3 read/write py2 pickle format Serhiy Storchaka <storchaka@gmail.com> - 2015-06-11 14:11 +0300
    Re: enhancement request: make py3 read/write py2 pickle format Chris Angelico <rosuav@gmail.com> - 2015-06-10 11:03 +1000

csiph-web