update python design patterns' code