Python class snippet allows changing of  base class