Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #92387
| X-FeedAbuse | http://nntpfeed.proxad.net/abuse.pl feeded by 78.192.65.63 |
|---|---|
| Path | csiph.com!usenet.pasdenom.info!nntpfeed.proxad.net!news.muarf.org!news.roellig-ltd.de!open-news-network.org!border2.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
| Return-Path | <jeanpierreda@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.002 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; '(except': 0.05; 'schema': 0.05; 'apps,': 0.07; 'alternatives': 0.09; 'front,': 0.09; 'migration': 0.09; 'repr': 0.09; 'str,': 0.09; 'cc:addr:python- list': 0.10; 'python': 0.11; 'syntax': 0.13; 'output': 0.15; 'eval': 0.16; 'inconvenient': 0.16; 'readable': 0.16; 'subject:make': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'trap.': 0.16; 'wrote:': 0.16; 'differ': 0.18; 'documented': 0.18; 'example.': 0.18; 'wednesday': 0.18; 'load': 0.20; 'library': 0.20; 'changes': 0.20; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; 'meant': 0.22; 'int,': 0.22; 'subject:request': 0.22; 'programming': 0.23; '2015': 0.23; 'passing': 0.23; 'specified': 0.23; 'header:In-Reply-To:1': 0.24; 'least': 0.27; 'data,': 0.27; 'message-id:@mail.gmail.com': 0.28; 'subject:/': 0.29; 'buffers': 0.29; 'protocols': 0.29; 'usable': 0.29; 'way?': 0.29; 'becomes': 0.31; 'compared': 0.31; "can't": 0.32; 'common': 0.33; "d'aprano": 0.33; 'steven': 0.33; 'languages': 0.34; 'received:google.com': 0.34; 'protocol': 0.35; 'text': 0.36; 'there': 0.36; 'subject:: ': 0.37; 'instead': 0.38; 'tue,': 0.38; 'pm,': 0.39; 'things': 0.39; 'does': 0.39; 'data': 0.40; 'back': 0.61; 'skip:u 10': 0.62; 'story': 0.63; 'great': 0.64; 'better.': 0.66; 'encourages': 0.66; 'potentially': 0.67; 'technology,': 0.71; 'sounds': 0.72; 'concept,': 0.84; 'dict.': 0.84; 'hole,': 0.84; 'reliability': 0.84; 'subject:read': 0.84; 'subject:write': 0.84; 'canonical': 0.91 |
| 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 :cc:content-type; bh=4LZNYjDFSX/ZQRGiHGnP5oXyj8B8OOCChU1OqFsWYgc=; b=fuWWe7P0Vi4N1VOJn1iVKkar619I6Bb3qMZUU3GIy5y/TWyY01DJXKuhNfgybnYzse xoqq26eGywcQNF1QP7U+0NoYesDnruFrtjVDf89QuJiTraC6CCz9HhBzaiTNTcFJtWv+ 6RKcHXovWUsJgzsc+crcjUFpzOkDD+5+FagAL3+RBp4r8jzonLNjxIxIL90nokAfDYEx CMrkoV+QCRHTfWpLbFg56NxgW7D28fchJVac/6wmM4Dp1IkBL4Nb546hJsijCEiuVj4G lWWNKkVcOggfgcLOTmQ7tt1Fx301eksUhTRVxcBuC1R+Ki+Q31p281PVc5SiUH3EAdFm 0gbw== |
| X-Received | by 10.180.100.194 with SMTP id fa2mr14911265wib.8.1433911761280; Tue, 09 Jun 2015 21:49:21 -0700 (PDT) |
| MIME-Version | 1.0 |
| In-Reply-To | <5577b46d$0$12975$c3e8da3$5496439d@news.astraweb.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> <mailman.328.1433897321.13271.python-list@python.org> <5577b46d$0$12975$c3e8da3$5496439d@news.astraweb.com> |
| From | Devin Jeanpierre <jeanpierreda@gmail.com> |
| Date | Tue, 9 Jun 2015 21:48:40 -0700 |
| Subject | Re: enhancement request: make py3 read/write py2 pickle format |
| To | "Steven D'Aprano" <steve+comp.lang.python@pearwood.info> |
| 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.332.1433911768.13271.python-list@python.org> (permalink) |
| Lines | 42 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1433911768 news.xs4all.nl 2882 [2001:888:2000:d::a6]:48411 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:92387 |
Show key headers only | View raw
On Tue, Jun 9, 2015 at 8:52 PM, Steven D'Aprano <steve+comp.lang.python@pearwood.info> wrote: > On Wednesday 10 June 2015 10:47, Devin Jeanpierre 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. > > In what way? I misspoke, and instead of "synonymous", meant "also means". (Implication, not equivalence.) >> For human readable serialized data, text format protocol buffers are >> seriously underrated. (Relatedly: underdocumented, too.) > > Ironically, literal_eval is designed to process text-format protocols using > human-readable Python syntax for common data types like int, str, and dict. "Protocol buffers" are a specific technology, not an abstract concept, and literal_eval is not a great idea. * the common serializer (repr) does not output a canonical form, and can serialize things in a way that they can't be deserialized * there is no schema * there is no well understood migration story for when the data you load and store changes * it is not usable from other programming languages * it encourages the use of eval when literal_eval becomes inconvenient or insufficient * It is not particularly well specified or documented compared to the alternatives. * The types you get back differ in python 2 vs 3 For most apps, the alternatives are better. Irmen's serpent library is strictly better on every front, for example. (Except potentially security, who knows.) At least it's better than pickle, security wise. Reliability wise, repr is a black hole, so no dice. :( -- Devin
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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