Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!news.tele.dk!news.tele.dk!small.news.tele.dk!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.041 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'example:': 0.03; 'failing': 0.07; 'cc:addr:python-list': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'nearest': 0.16; '{true:': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'simpler': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'skip:p 30': 0.29; 'forgot': 0.30; 'message-id:@mail.gmail.com': 0.30; 'easier': 0.31; '>>>>': 0.31; 'marc': 0.31; 'subject:the': 0.34; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'fact': 0.38; 'pm,': 0.38; 'rather': 0.38; 'even': 0.60; 'hope': 0.61; 'offer': 0.62; 'reach': 0.63; 'mar': 0.68; 'hammer': 0.84; 'to:none': 0.92 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=FfOIRNFdVdXkNQoiHOpeB+OJkJ4OrZGjmY3C2VuyoUQ=; b=fvNF6JD30NwCT/Q/BodT/TG/4cAPmWeZHwT6NLVQaTnbfksmlu7HjHMc7sx1h8PCC+ tHINDatJfOgsK3zBPzqGm3CRh91RnKFtymeyvglEP9f2An0SSUtNoCiSy/sYCAriB5gz IdkzeUJmjYqayADDSJU81GdRMG/PtEDCk7rZXQD+VAuVCaYow4OD1rSkX1eG1tkI+bmf QVpi3W4rq0mU/WVRjfpVep367iEl9mlxt1HdL+NnqUfK1/cq+qFR6Xz/s0D5akuHxOiO EAJBsjDfaCrSd+sPypUFpYc2tY3ZwB+oL4jmlCRayk1RfhdFdcUE3qEvuiyHgRqK8k48 3Xmg== MIME-Version: 1.0 X-Received: by 10.68.200.74 with SMTP id jq10mr320959pbc.169.1395129317507; Tue, 18 Mar 2014 00:55:17 -0700 (PDT) In-Reply-To: References: Date: Tue, 18 Mar 2014 18:55:17 +1100 Subject: Re: Ordering in the printout of a dictionary From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1395129321 news.xs4all.nl 2922 [2001:888:2000:d::a6]:54334 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:68494 On Tue, Mar 18, 2014 at 6:36 PM, Marc Christiansen wrote: > I would say using pprint.pprint is even easier and it works with your > failing example: > >>>> pprint.pprint({True:1,"Hello":2}) > {True: 1, 'Hello': 2} > True. I could try to say that I prefer to offer the simpler approach rather than encourage people to automatically reach for the nearest hammer and hope it's right, but the fact is... I completely forgot about pprint :) ChrisA