# "heavy" approach (can be useful if you want to derive # and add simple behavior, e.g. validation etc.) class Attributes: def __init__(self, **kwargs): # Alternatively: # self.__dict__.update(kwargs) for k, v in kwargs.items(): setattr(self, k, v) # or otherwise: d = lambda: None d.foo = "bar" d.moo = "baaaaaaaaa"