Common design patterns implemented in Python