Simon Brunning wrote: > On 8/10/05, Chris Cioffi <[EMAIL PROTECTED]> wrote: > >>I have lots of code that looks like: >> keys = mydict.keys() >> keys.sort() > > > keys = sorted(mydict.keys()) > Or (often useful to get at contents):
items = sorted(mydict.items())
as in:
For key, value in sorted(mydict.items()):
print '%s -> %r' % (key, value)
-Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
