Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #92463
| Path | csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| 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; 'badly': 0.07; 'doctest': 0.07; 'json': 0.07; 'dict': 0.09; 'output,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'repr': 0.09; 'ruby,': 0.09; 'stable.': 0.09; 'output': 0.15; 'thu,': 0.15; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:make': 0.16; 'textual': 0.16; "{'a':": 0.16; 'wrote:': 0.16; 'module,': 0.18; 'examples': 0.18; 'tests': 0.18; 'library': 0.20; 'keys': 0.22; 'subject:request': 0.22; 'pass': 0.22; 'am,': 0.23; '2015': 0.23; 'module': 0.23; "python's": 0.23; 'header:In- Reply-To:1': 0.24; 'somewhere': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'chris': 0.26; '[2]': 0.27; 'subject:/': 0.29; 'buffers': 0.29; 'such.': 0.29; 'e.g.': 0.31; 'problem': 0.33; 'equal': 0.34; 'to:addr:python-list': 0.35; 'involving': 0.35; 'protocol': 0.35; 'but': 0.36; 'text': 0.36; 'there': 0.36; 'two': 0.37; 'should': 0.37; "didn't": 0.37; 'subject:: ': 0.37; 'received:org': 0.38; 'to:addr:python.org': 0.39; 'why': 0.40; 'different': 0.64; 'charset:windows-1252': 0.65; 'ordered.': 0.84; 'subject:read': 0.84; 'subject:write': 0.84 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Serhiy Storchaka <storchaka@gmail.com> |
| Subject | Re: enhancement request: make py3 read/write py2 pickle format |
| Date | Thu, 11 Jun 2015 14:11:25 +0300 |
| 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> <mailman.332.1433911768.13271.python-list@python.org> <5578053a$0$11102$c3e8da3@news.astraweb.com> <CABicbJJFURk+kwUO-wz8K5ZXY5TYUpqor1DLr0T30PaLkW5w4A@mail.gmail.com> <CAPTjJmrUWPv9sAO-UZc+xkSatS=LyLBdSJzpcNqFo1ByDKMUHg@mail.gmail.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=windows-1252; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Gmane-NNTP-Posting-Host | 193.202.118.163 |
| User-Agent | Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
| In-Reply-To | <CAPTjJmrUWPv9sAO-UZc+xkSatS=LyLBdSJzpcNqFo1ByDKMUHg@mail.gmail.com> |
| 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.389.1434021095.13271.python-list@python.org> (permalink) |
| Lines | 20 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1434021095 news.xs4all.nl 2903 [2001:888:2000:d::a6]:48479 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:92463 |
Show key headers only | View raw
On 11.06.15 02:58, Chris Angelico wrote:
> On Thu, Jun 11, 2015 at 8:10 AM, Devin Jeanpierre
> <jeanpierreda@gmail.com> wrote:
>> The problem is that there are two different ways repr might write out
>> a dict equal to {'a': 1, 'b': 2}. This can make tests brittle -- e.g.
>> it's why doctest fails badly at examples involving dictionaries. Text
>> format protocol buffers output everything sorted, so that you can do
>> textual diffs for compatibility tests and such.
>
> With Python's JSON module [1], you can pass sort_keys=True to
> stipulate that the keys be lexically ordered, which should make the
> output "canonical". Pike's Standards.JSON.encode() [2] can take a flag
> value to canonicalize the output, which currently has the same effect
> (sort mappings by their indices). I did a quick check for Ruby and
> didn't find anything in its standard library JSON module, but knowing
> Ruby, it'll be available somewhere in a gem.
AFAIK Ruby's dicts are ordered. So the output is pretty stable.
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