0
In the module functools
of bibliotaca padrão
of Python
there are two functions update_wrapper
and wraps
in the documentation of the function wraps
we have:
This is a convenience Function for invoking
update_wrapper()
as to Function Decorator when Defining a wrapper Function. It is equivalent topartial(update_wrapper, wrapped=wrapped, assigned=assigned, updated=updated)
.
I know the function update_wrapper
is called internally by wraps
, would like an example where it is necessary to use the function update_wrapper
and not of wraps
.
Related question in the Soen
– Tuxpilgrim
The @nosklo reply explains well.
update_wrapper()
does all the magic andwraps()
serves to useupdate_wrapper
as Decorator.– fernandosavio