Moreover, for on-the-fly ordering you can consider to use sorted() on yourdict.keys(), like: for k in sorted(yourdict.keys()): print k, yourdict[k] I think it has no side effects, except that the orderering can be slow on huge data sets, and that you need to call it every time after updating the dict keys. Regards, insomniac