Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #68494

Re: Ordering in the printout of a dictionary

References <lg8462$fnk$1@news.albasani.net> <mailman.8231.1395103693.18130.python-list@python.org> <cl9lva-45d.ln1@pluto.solar-empire.de>
Date 2014-03-18 18:55 +1100
Subject Re: Ordering in the printout of a dictionary
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.8246.1395129321.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, Mar 18, 2014 at 6:36 PM, Marc Christiansen
<usenetmail@solar-empire.de> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Ordering in the printout of a dictionary Mok-Kong Shen <mok-kong.shen@t-online.de> - 2014-03-18 01:32 +0100
  Re: Ordering in the printout of a dictionary Chris Angelico <rosuav@gmail.com> - 2014-03-18 11:48 +1100
    Re: Ordering in the printout of a dictionary John Gordon <gordon@panix.com> - 2014-03-18 02:56 +0000
    Re: Ordering in the printout of a dictionary Marc Christiansen <usenetmail@solar-empire.de> - 2014-03-18 08:36 +0100
      Re: Ordering in the printout of a dictionary Chris Angelico <rosuav@gmail.com> - 2014-03-18 18:55 +1100

csiph-web