functools.wraps decorator does not work with objects in python 2