There\'s an existing function that ends in the following, where d is a dictionary:
d
return d.iteritems()
that returns an unsort
Greg's answer is right. Note that in Python 3.0 you'll have to do
sorted(dict.items())
as iteritems will be gone.
iteritems