This is what I would like.
def add_things_to_x(x,list_of_things):
for item in list_of_things:
x.item = item
return x
How can I do this?
And as it seems so hard to do I am guessing there may be a better way and a reason not to do this?
An example of how I might use such a function.
average_height = 10
std_height = 3
x = load_data()
x = add_things_to_x(x,[average_height,std_height])
x.save_data()
so that later on if I pickle.load(x) I could do call x.std_height and x.average_height