class Foo(object):
    a, b, c = '', '', ''
foo = Foo()
_dict = {'a': 'bar', 'b': 'blah', 'c': 'abc', 'd': 'nada'}
for k, v in _dict.items():
    if hasattr(foo, k):
        setattr(foo, k, v)
Python dictionary to variable assignments based on key value to variable name