Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'badly': 0.07; 'doctest': 0.07; 'dict': 0.09; 'objects.': 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; 'jan': 0.11; 'compares': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:make': 0.16; "{'a':": 0.16; 'wrote:': 0.16; 'string': 0.17; 'examples': 0.18; 'tests': 0.18; 'compare': 0.20; 'subject:request': 0.22; 'dependent': 0.23; 'sets': 0.23; 'header:In-Reply-To:1': 0.24; 'written': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'subject:/': 0.29; 'terry': 0.29; 'objects': 0.29; 'random': 0.29; 'values': 0.30; 'code': 0.31; 'addresses': 0.32; 'problem': 0.33; 'equal': 0.34; 'to:addr:python-list': 0.35; 'involving': 0.35; 'strongly': 0.35; 'possible.': 0.36; 'there': 0.36; 'two': 0.37; 'should': 0.37; 'subject:: ': 0.37; 'rather': 0.38; 'received:org': 0.38; 'pm,': 0.39; 'to:addr:python.org': 0.39; 'why': 0.40; 'different': 0.64; 'subject:read': 0.84; 'subject:write': 0.84; 'received:fios.verizon.net': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: enhancement request: make py3 read/write py2 pickle format Date: Wed, 10 Jun 2015 19:25:33 -0400 References: <55778208$0$2899$e4fe514c@news2.news.xs4all.nl> <5577b46d$0$12975$c3e8da3$5496439d@news.astraweb.com> <5578053a$0$11102$c3e8da3@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-98-114-97-173.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: 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: 1433978778 news.xs4all.nl 2852 [2001:888:2000:d::a6]:37835 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:92430 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. > it's why doctest fails badly at examples involving dictionaries. or sets or addresses or object ids or locale-dependent strings or random numbers or values dependent on random numbers. -- Terry Jan Reedy