3 ms·
Consider functools.wraps[1] in your own decorators. This uses functools.update_wrapper to copy the name, docstring, and some other other attributes[2] from the
by osteele 9y ago
Consider functools.wraps[1] in your own decorators. This uses functools.update_wrapper to copy the name, docstring, and some other other attributes[2] from the wrapped function to the wrapper.
[1]: https://docs.python.org/3/library/functools.html#functools.wraps https://docs.python.org/3/library/functools.html#functools.w...
[2]: https://docs.python.org/3/library/functools.html#functools.update_wrapper https://docs.python.org/3/library/functools.html#functools.u...
EDIT: s/wrapped/wraps/; tip of the hat to @ramnes
- ramnes 9y agoYes! It's functools.wraps*, though. :)