Dictionary...

Duncan Booth duncan at NOSPAMrcp.co.uk
Fri Sep 6 14:42:40 CEST 2002


Isaac To <kkto at csis.hku.hk> wrote in
news:7ir8g7xqqk.fsf at enark.csis.hku.hk: 

> After all, Python dictionaries are implemented by height balancing
> tree, so internally the needed data can be retrieved efficiently. 

I think you must be using a different implementation of Python than the 
rest of us. :-)

Python dictionaries are implemented using hash tables and have no implied 
order. Try creating a dictionary using complex numbers as keys if you don't 
believe me, then try sorting the keys of that dictionary.

-- 
Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?



More information about the Python-list mailing list