Skip to content
RED SAGSkills
hard20 pts · first answer countspythonpython-basics

A decorator hides the function name

After this decorator is applied, report.__name__ prints "wrapper" and the docstring is gone. What fixes it?

def timed(fn):
    def wrapper(*args, **kwargs):
        return fn(*args, **kwargs)
    return wrapper

@timed
def report(): ...
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions