What I'd like to accomplish is to set testobj.alpha to .5 in the example below:
class test():
def __init__(self):
self.alpha = 0
d = {'alpha' : .5}
testobj = test()
for i in d:
testobj.i = d[i] #creates a new class member called 'i' instead of setting alpha to .5
As the comment says, in the for loop, a new class member called i is created, rather than setting the existing alpha member to .5