human
I wrote the below code

    def func(self, *args, **kwargs):
        self.__doc__ = method.__doc__
        query = method(self, *args, **kwargs)
        if hasattr(query, '__iter__'):
            result = list(query)
            return (result[0] if result else None)
        else:
            return query
    return update_wrapper(func, method)

What's a good function header?
assistant
#Here's a good function header.

def returns_typeclass(method):