I suppose you are looking for something like this:
class DemoClassWhichSolvesProblemButWithoutUnnededFunctions(object):
def __init__(self, arg1, arg2, arg3):
self.arg1 = arg1
self.arg2 = arg2
self.arg3 = arg3
def controls(self, attribute_value_pair):
eval_string = attribute_value_pair[0] + " = " + str(attribute_value_pair[1])
exec(eval_string)
value1, value2, value3 = (1, 2, 3)
my_object = DemoClassWhichSolvesProblemButWithoutUnnededFunctions(0, 0, 0)
print "original values:", my_object.__dict__
inputs = {"A":["self.arg1", value1],
"S":["self.arg2", value2],
"D":["self.arg3", value3]}
my_object.controls(inputs["A"]) #my object, not my class...
my_object.controls(inputs["S"])
my_object.controls(inputs["D"])
#Even this one works:
my_object.controls( ("self.totally_new_attribute", "str('other value')") )
print "modified values:", my_object.__dict__
exec
takes a string and treats it like a command line written here - which could cause some harm! But I assume you are looking for a solution like this...