Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python
An ordered dictionary for the Python library?
 

Index | Next | Previous | View Flat


m.n.summerfield at googlemail

Sep 12, 2007, 12:33 AM


Views: 316
Permalink
An ordered dictionary for the Python library?

I feel that Python lacks one useful data structure: an ordered
dictionary.

I find such data structures v. useful in C++. I know that in Python
the sort function is v. fast, but often I prefer never to sort but
simply to use an ordered data structure in the first place.
(I'm aware that for ordered lists I can use the bisect module, but I
want an ordered key-value data structure.)

I think other people must find such things useful. There are three
implementations on the Python Cookbook site, and one on PyPI, all in
pure Python (plus I have my own implementation, also pure Python).

I would suppose that it would be better if it was implemented in C---
for example, my own pure Python ordered dict loads data about eight
times slower than the built-in dict. Nonetheless, I still find it
worth using for the convenience it offers.

Do other Python programmers feel this lack? Is this worth a PEP?

[.I originally asked about this on the P3K mailing list, but then
realised that it isn't version-specific really.]

--
http://mail.python.org/mailman/listinfo/python-list

Subject User Time
An ordered dictionary for the Python library? m.n.summerfield at googlemail Sep 12, 2007, 12:33 AM
    Re: An ordered dictionary for the Python library? michele.simionato at gmail Sep 12, 2007, 12:47 AM
    Re: An ordered dictionary for the Python library? s.mientki at id Sep 12, 2007, 12:51 AM
        Re: An ordered dictionary for the Python library? steve at REMOVE-THIS-cybersource Sep 12, 2007, 5:52 AM
    Re: An ordered dictionary for the Python library? BjornSteinarFjeldPettersen at gmail Sep 12, 2007, 3:28 AM
    Re: An ordered dictionary for the Python library? steve at REMOVE-THIS-cybersource Sep 12, 2007, 5:42 AM
        Re: An ordered dictionary for the Python library? michele.simionato at gmail Sep 12, 2007, 5:46 AM
        Re: An ordered dictionary for the Python library? duncan.booth at invalid Sep 12, 2007, 7:15 AM
        Re: An ordered dictionary for the Python library? pavlovevidence at gmail Sep 12, 2007, 9:18 AM
        Re: An ordered dictionary for the Python library? rowen at cesmail Sep 12, 2007, 12:08 PM
    Re: An ordered dictionary for the Python library? m.n.summerfield at googlemail Sep 12, 2007, 6:54 AM
    Re: An ordered dictionary for the Python library? michele.simionato at gmail Sep 12, 2007, 7:04 AM
    Re: An ordered dictionary for the Python library? rschroev_nospam_ml at fastmail Sep 12, 2007, 7:17 AM
    RE: An ordered dictionary for the Python library? whamil1 at entergy Sep 12, 2007, 7:39 AM
    Re: An ordered dictionary for the Python library? arkanes at gmail Sep 12, 2007, 8:49 AM
    Re: An ordered dictionary for the Python library? pavlovevidence at gmail Sep 12, 2007, 9:06 AM
    Re: An ordered dictionary for the Python library? horpner at yahoo Sep 12, 2007, 9:58 AM
    Re: An ordered dictionary for the Python library? m.n.summerfield at googlemail Sep 12, 2007, 10:07 AM
    Re: An ordered dictionary for the Python library? tuomas.vesterinen at pp Sep 12, 2007, 2:25 PM
    Re: An ordered dictionary for the Python library? "http://phr.cx" at NOSPAM Sep 12, 2007, 4:03 PM
        Re: An ordered dictionary for the Python library? m.n.summerfield at googlemail Sep 12, 2007, 11:27 PM
    Re: An ordered dictionary for the Python library? apardon at forel Sep 13, 2007, 12:06 AM
    Re: An ordered dictionary for the Python library? mensanator at aol Sep 13, 2007, 10:19 AM
    Re: An ordered dictionary for the Python library? "http://phr.cx" at NOSPAM Sep 13, 2007, 1:14 PM
        Re: An ordered dictionary for the Python library? jUrner at arcor Sep 13, 2007, 6:35 PM
    Re: An ordered dictionary for the Python library? jstroud at mbi Sep 13, 2007, 1:20 PM
        Re: An ordered dictionary for the Python library? jstroud at mbi Sep 13, 2007, 3:30 PM
        Re: An ordered dictionary for the Python library? pavlovevidence at gmail Sep 13, 2007, 6:36 PM
    Re: An ordered dictionary for the Python library? jstroud at mbi Sep 13, 2007, 7:21 PM
        Re: An ordered dictionary for the Python library? pavlovevidence at gmail Sep 14, 2007, 9:58 PM
    Re: An ordered dictionary for the Python library? m.n.summerfield at googlemail Sep 14, 2007, 12:12 AM
    Re: An ordered dictionary for the Python library? m.n.summerfield at googlemail Sep 14, 2007, 2:07 AM
    Re: An ordered dictionary for the Python library? apardon at forel Sep 14, 2007, 2:49 AM
        Re: An ordered dictionary for the Python library? m.n.summerfield at googlemail Sep 14, 2007, 3:56 AM
    Re: An ordered dictionary for the Python library? apardon at forel Sep 14, 2007, 4:46 AM
        Re: An ordered dictionary for the Python library? m.n.summerfield at googlemail Sep 14, 2007, 6:56 AM
    Re: An ordered dictionary for the Python library? apardon at forel Sep 14, 2007, 7:35 AM
        Re: An ordered dictionary for the Python library? m.n.summerfield at googlemail Sep 14, 2007, 9:43 AM
    Re: An ordered dictionary for the Python library? jstroud at mbi Sep 14, 2007, 12:25 PM
        Re: An ordered dictionary for the Python library? m.n.summerfield at googlemail Sep 14, 2007, 1:00 PM
    Re: An ordered dictionary for the Python library? jstroud at mbi Sep 14, 2007, 1:23 PM
        Re: An ordered dictionary for the Python library? m.n.summerfield at googlemail Sep 14, 2007, 10:10 PM
    Re: An ordered dictionary for the Python library? deets at nospam Sep 15, 2007, 12:32 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.