design pattern using python