Iterating over a dictionary's sorted keys

Mark Hammond mhammond at skippinet.com.au
Sun May 28 23:15:19 EDT 2000


"Alan Daniels" <daniels at mindspring.com> wrote in message
news:slrn8j34u8.j8.daniels at localhost.localdomain...

> then maybe I would :-), so I see your point. Still the getting of a
> list of sorted keys is really, really handy, so hopefully
>
>     keys = some_dict.sorted_keys()

I agree its handy, but dont think it's worth adding a convenience function
to collapse two lines down to one.  There are _lots_ of really, really
handy things you can do in 2 lines of Python, so where would we stop?

Mark.






More information about the Python-list mailing list