I am developing a multiplayer game. When I use an object from inventory, it should update the user creature\'s stats with the values of the attributes of an object.
Don't use __dict__. Use getattr and setattr to modify attributes by name:
__dict__
getattr
setattr
for attribute in obj.attributes: setattr(cur_creature,str(attribute.Name), getattr(cur_creature,str(attribute.Name)) + attribute.Value)
More info: