Design patterns in Python