[Tutor] speeding code along

alan.gauld@bt.com alan.gauld@bt.com
Mon Nov 18 06:20:02 2002


> i did think about that, but decided that in the end it would probably
> take just as long to lookup 3 values in a list of values (by 
> the end of the image, this list would be thousands long anyway), as it 
> would to do the math.... ahh well...

Only if it was a list. 
Use a dictionary and it will be orders of magnitude faster!
Of course you need to find a way to identify unique keys, 
but that shouldn't be impossible - remember tuples can be 
keys too...

Alan G.