dynamicly updating an objects fields

Robert Kern rkern at ucsd.edu
Wed Aug 31 10:16:03 EDT 2005


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
rkern at ucsd.edu

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter




More information about the Python-list mailing list