VB (and C99 and C#, actually) have a way to set multiple attributes on one object with a contracted syntax where you don\'t have to repeat the object name before \".\" . Is
def update_attr(obj, **kw): for key, value in kw.iteritems(): setattr(obj, key, value)
class X: pass x = X() update_attr(x, blue=3, red=5) update_attr(x, **{'yellow': 6}) print vars(x)
{'blue': 3, 'yellow': 6, 'red': 5}