When I put a class method under a decorator it hides the method description ("""x""") in help(class_name). How can I fix that please ?
Asked
Active
Viewed 115 times
1 Answers
2
Using functools.wraps:
def decorator(f):
@functools.wraps(f)
def wrapped(*args):
# do something
return wrapped

Marco Cerliani
- 21,233
- 3
- 49
- 54

Bubble Bubble Bubble Gut
- 3,280
- 12
- 28
-
Nice, never heard of this! – touch my body Apr 18 '18 at 20:46