def assign(self, allowed_kwargs={'foo', 'bar', 'baz'}, **kwargs):
    if kwargs.keysview() - allowed_kwargs:
        raise TypeError('useful message here...')
for k in allowed_kwargs:
    setattr(self, k, kwargs[k])
Pythonic way to assign the parameter into attribute?