Re: dynamicly updating an objects fields

2005-08-31 Thread Robert Kern
Uwe Lauth wrote: > kyle.tk wrote: > >>I want to make a function that will work like this: >> >>def updateField(object, fieldName, newValue): >> object.fieldName = newValue > > This function already exists in python. > It is called settattr. Or rather setattr. -- Robert Kern [EMAIL PROTECT

Re: dynamicly updating an objects fields

2005-08-30 Thread Uwe Lauth
kyle.tk wrote: > I want to make a function that will work like this: > > def updateField(object, fieldName, newValue): > object.fieldName = newValue This function already exists in python. It is called settattr. Regards Uwe -- http://mail.python.org/mailman/listinfo/python-list

dynamicly updating an objects fields

2005-08-30 Thread kyle.tk
I want to make a function that will work like this: def updateField(object, fieldName, newValue): object.fieldName = newValue fieldName could be anything, the list of objects fields will grow as my project goes on and i want to reuse the same code without adding more if statements to it