class Bar(object): def __init__(self, **kwargs): self.__dict__.update(kwargs) >>> bar = Bar(a=1, b=2) >>> bar.a 1