Print dict in sorted order

Wolfgang Grafen wolfgang.grafen at
Mon Jan 30 08:03:34 EST 2006

Use the package:

What is it?


Sorry, this link is broken - have to fix it asap. has been successfully used in several projects... and it is *easy* and



Kamilche wrote:
> I have a code snippet here that prints a dict in an arbitrary order.
> (Certain keys first, with rest appearing in sorted order). I didn't
> want to subclass dict, that's error-prone, and overkill for my needs. I
> just need something that returns a value like dict.__str__, with a key
> ordering I specify.

More information about the Python-list mailing list