Sorted dictionary

Steven D'Aprano steven at
Thu Jan 21 02:50:58 CET 2010

On Thu, 21 Jan 2010 02:02:02 +0100, Jan Kaliszewski wrote:

> Hello,
> Inspired by some my needs as well as some discussions in the net, I've
> implemented a sorted dictionary (i.e. a dict that returns keys, values
> and items always sorted by keys):

What's the advantage of that over sorting the keys as needed?


for key in sorted(dict):
    print key



More information about the Python-list mailing list