[poll] anyone else needs fast random element access off a dictionary?

David Eppstein eppstein at ics.uci.edu
Tue Feb 11 12:40:25 EST 2003


In article <mailman.1044981517.1322.python-list at python.org>,
 Michal Vitecek <fuf at mageo.cz> wrote:

>  i'd like to ask if there exist people (like me) who have a need to get
>  random elements off a dictionary and cannot use lists because they need
>  a fast data lookup/retrieval.

Any reason you can't create your own module that stores both a list and 
a dict, keeps them in synch, uses the dicts for the fast lookups, and 
uses the lists for fast random access?

-- 
David Eppstein       UC Irvine Dept. of Information & Computer Science
eppstein at ics.uci.edu http://www.ics.uci.edu/~eppstein/




More information about the Python-list mailing list