Archive for October 21, 2009

The factory pattern in Python with __new__

Python’s __new__ function allows you to implement the factory pattern in a nice elegant syntax.