Hey, I just started wondering about this as I came upon a code that expected an object with a certain set of attributes (but with no specification of what type this object shoul
Use a combination between lambda and type build-in, I think is the smallest way to do that:
obj = lambda **kwargs: type('obj', (object,), kwargs)() options = obj(do_good_stuff=True, do_bad_stuff=False) print options.do_good_stuff print options.do_bad_stuff