def deepcopy_return_value_class_decorator(cls):
 class NewClass(cls, ):
  def __getattribute__(self, attr_name):
   obj = super(NewClass, self).__getattribute__(attr_name)
   if (hasattr(obj, '__call__') and (not attr_name.startswith('_')) and (not isinstance(obj, mock.Mock))):
    return deepcopy_return_value_method_decorator(obj)
   return obj
 return NewClass

def deepcopy_return_value_class_decorator ( cls ) : class NewClass ( cls , ) : def __getattribute__ ( self , attr_name ) : obj = super ( NewClass , self ) . __getattribute__ ( attr_name ) if ( hasattr ( obj , '__call__' ) and ( not attr_name . startswith ( '_' ) ) and ( not isinstance ( obj , mock . Mock ) ) ) : return deepcopy_return_value_method_decorator ( obj ) return obj return NewClass
wraps non-protected methods of a class with decorator .