0

What is the best way to avoid situations where you need to hard code the index of the item in a list, like the following example?
# retrieve some data from sql database
raw_data = ...
# create ItemPrior objects for each row of the results
priors = {}
for row in raw_data:
priors[row[3]] = I...