Functools: functools.wraps
Let's talk about functool tools and their functions.
Overview of wraps
tool
There is a little known tool that we wanted to cover in this lesson. It
is called wraps
and it too is a part of the functools
module. We can use wraps as a decorator to fix docstrings
and names of decorated functions.
Why does this matter? This sounds like a weird edge case at first, but if we are writing an API or any code that someone other than ourself will be using, then this could be important. The reason is that when we use ...
Get hands-on with 1400+ tech skills courses.