You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.6 64bit
Expected behaviour
Actual behaviour
Steps to reproduce
fromfunctoolsimportwrapsdefdecorator(func):
""" This is the decorator doc """@wraps(func)defwrapper(*args, **kwargs):
""" This is the wrapper doc """returnfunc(*args, **kwargs)
returnwrapper@decoratordefsome_func():
""" This is the actual doc """return1+1some_func()
print(some_func.__name__)
print(some_func.__doc__)
The text was updated successfully, but these errors were encountered:
When you create a decorator, it replaces the function that it's decorating. Many decorators (like the one in your example) return the original function. This fact can be obscured to the type checker because of the way the they are annotated.
For a detailed explanation and the recommended fix, see this issue. If you apply this fix within your code, the docstring of the original function will appear as you expect.
Environment data
Expected behaviour
Actual behaviour
Steps to reproduce
The text was updated successfully, but these errors were encountered: