"Ordered" dicts

Chris Cioffi evenprimes at gmail.com
Wed Aug 10 16:15:07 CEST 2005

On 10/08/05, Simon Brunning <simon.brunning at gmail.com> wrote: 
> On 8/10/05, Chris Cioffi <evenprimes at gmail.com> wrote:
> > I have lots of code that looks like:
> > keys = mydict.keys()
> > keys.sort()
> keys = sorted(mydict.keys())

 While the sorted() built in addressed (yet another) community desire, I 
don't think this addresses the underlying expectation of getting dictionary 
keys in some order. 
 It works, but it feel like a kludge to me. <shrug>
"Obviously crime pays, or there'd be no crime." -- G. Gorden Liddy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20050810/290278f9/attachment.html>

More information about the Python-list mailing list