Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'diff': 0.05; 'dict': 0.09; 'objects.': 0.09; 'repr': 0.09; 'cc:addr:python-list': 0.10; 'wed,': 0.15; 'output': 0.15; '4:25': 0.16; 'compares': 0.16; 'reedy': 0.16; 'subject:make': 0.16; 'two,': 0.16; "{'a':": 0.16; 'wrote:': 0.16; 'string': 0.17; 'comparing': 0.18; 'tests': 0.18; 'compare': 0.20; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; 'subject:request': 0.22; 'text,': 0.22; '2015': 0.23; '(like': 0.23; 'header:In-Reply-To:1': 0.24; 'written': 0.24; 'message- id:@mail.gmail.com': 0.28; 'subject:/': 0.29; 'terry': 0.29; 'objects': 0.29; 'code': 0.31; 'problem': 0.33; 'equal': 0.34; 'received:google.com': 0.34; 'formats': 0.35; 'strongly': 0.35; 'text': 0.36; 'except': 0.36; 'possible.': 0.36; 'there': 0.36; 'two': 0.37; 'should': 0.37; 'subject:: ': 0.37; 'difference': 0.38; 'rather': 0.38; 'pm,': 0.39; 'easily': 0.39; 'data': 0.40; 'different': 0.64; 'other.': 0.64; 'between': 0.65; 'subject:read': 0.84; 'subject:write': 0.84 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=DNtDfBE3SvPVp3fUSLp93YM7ebTz6rW9xMYUlA8yAkM=; b=adepKUhNg+UCGx3UZKBdGSxbbML/acwgLDL033xCjDeCfFYwnTeLtarAqDD+d1bnw4 Y57cxYueDZ7s4WsUEGKE1VQbKZwFkXj1J4oVONEMWZJki3pA3a5EKZ0sjYZsA05N5R3/ p3ziRYSh+YJU7vnnIUXB5Q5ONlIfHO/dglZgHpj8ePoAlvIGCyUfO0z17wZn2WJHahO6 Drl+RSmdL69/4h2nQmvhjVMesO002zHtSH704ssLleT9EH2Q/YDkbCnxCWx6wdFWF5Ji SYVGbGlJ+QkXj+y3Yhum6i2NQXQs0MZgFC+mPnfKGqNStrOXaCf0fl0G525GtMk+CjJg xQ9g== X-Received: by 10.180.94.168 with SMTP id dd8mr23472721wib.76.1433979629873; Wed, 10 Jun 2015 16:40:29 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <55778208$0$2899$e4fe514c@news2.news.xs4all.nl> <5577b46d$0$12975$c3e8da3$5496439d@news.astraweb.com> <5578053a$0$11102$c3e8da3@news.astraweb.com> From: Devin Jeanpierre Date: Wed, 10 Jun 2015 16:39:49 -0700 Subject: Re: enhancement request: make py3 read/write py2 pickle format To: Terry Reedy Cc: "comp.lang.python" 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1433979632 news.xs4all.nl 2850 [2001:888:2000:d::a6]:44215 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:92432 On Wed, Jun 10, 2015 at 4:25 PM, Terry Reedy wrote: > On 6/10/2015 6:10 PM, Devin Jeanpierre 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 > > > Not if one compares objects rather than string representations of objects. > I am strongly of the view that code and tests should be written to directly > compare objects as much as possible. For serialization formats that always output the same string for the same data (like text format protos), there is no practical difference between the two, except that if you're comparing text, you can easily supply a diff to update one to match the other. -- Devin