This was what one of our Java coworkers wrote a while back: https://gist.github.com/1337/8155054
Yuck.
Wow... I've never felt the need to the use the factory technique.
Interfaces instead are completely unpythonic. Or, maybe I should call them antipythonic?
[setattr(self, x, kwargs[x]) for x in kwargs.keys()]
Though of course that is a bit too slow and he should do self.__dict__.update(**kwargs)
or for maximum correctness import os; os.remove(__file__)