[Tutor] Matching dictionary entries by partial key

Kent Johnson kent37 at tds.net
Fri Oct 7 14:03:27 CEST 2005


Danny Yoo wrote:
> But as Kent mentioned, though, perhaps the easiest thing to implement is a
> simple linear scan across all your key-values, and not worry until we know
> this is a performance hotspot.  *grin* It really depends on how many
> entries we're searching against.

Another alternative is just a list of (key, value) pairs, that is easy to search with linear search. The only reason to keep a dict is if you are at some point doing a lookup by key. Without knowing more about your app I don't know if that is a requirement or not.

Kent



More information about the Tutor mailing list