Ordering in the printout of a dictionary

Chris Angelico rosuav at gmail.com
Tue Mar 18 03:55:17 EDT 2014


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



More information about the Python-list mailing list