class Struct: def __init__(self, **entries): self.__dict__.update(entries) class tester: def __init__(self): enum = Struct testing = enum(one=1, two=2, three=3) print testing.one print testing.two print testing.three mytest = tester()