Re: Iterating Over Dictionary From Arbitrary Location

2009-06-07 Thread bearophileHUGS
Aahz: > See various "ordered dictionary" implementations > for ideas on coding this. But be careful to not confuse ordered dictionaries with sorted ones :-) Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Iterating Over Dictionary From Arbitrary Location

2009-06-07 Thread Aahz
In article , akindo wrote: > >So, it seems I want the best of both worlds: specific indexing using >my own IDs/keys (not just by list element location), sorting and the >ability to start iterating from a specific location. I am trying to >prevent having to scan through a list from the begin

Re: Iterating Over Dictionary From Arbitrary Location

2009-06-06 Thread bearophileHUGS
akindo: > So, it seems I want the best of both worlds: specific indexing using   > my own IDs/keys (not just by list element location), sorting and the   > ability to start iterating from a specific location. A sorted associative map may be fit. A data structure based on a search tree, like a red-

Re: Iterating Over Dictionary From Arbitrary Location

2009-06-06 Thread Diez B. Roggisch
akindo schrieb: Hi all. I am new to Python and have a problem regarding data structures. In my application I will be having several messages and my own type of IDs (Lamport clocks) to go with these messages. I will need to frequently ask for specific messages based on the ID. Hence a dictionar