class Foo:

    def setAllWithKwArgs(self, **kwargs):
        for key, value in list(kwargs.items()):
            setattr(self, key, value)
How can you set class attributes from variable arguments (kwargs) in python